此主题相关图片如下:图像 3.png
If e.Sender.Value = "" Then Return
Functions.Execute("加载筛选",e.Form.Controls("筛选"),e.Form.Name & "_Tbl_Main",e.Sender.Value.Replace(",","|"))
'此函数用于更新主窗口左侧的Treeview控件
Dim TvwCtl As WinForm.TreeView = Args(0) '要更新的Treeview控件
Dim TblName As String = Args(1) '数据来源表
Dim Columns As String = Args(2) '要构建Treeview的字段
If Tables(TblName).Rows.Count = 0 Then Return Nothing
TvwCtl.Form.StopRedraw
TvwCtl.BuildTree(Tables(TblName).DataTable,Columns)
Dim ArrColName() As String = Columns.Split("|")
For i As Integer = 0 To Ubound(ArrColName)
If Tables(TblName).DataTable.DataCols(ArrColName(i)).IsDate Then
Dim Dt As Date = Tables(TblName).DataTable.DataRows(0)(ArrColName(i))
If Dt.Hour = 0 And Dt.Minute = 0 And Dt.Minute = 0 Then
For Each Nd As WinForm.TreeNode In TvwCtl.AllNodes
If Nd.Level = i Then Nd.Text = Nd.Text.SubString(0,Nd.Text.IndexOf(" "))
Next
End If
End If
Next
TvwCtl.Nodes.Insert("显示所有行",0)
TvwCtl.Form.ResumeRedraw
老师,我把用黄色标出的代码设置在窗口事件里后有严重报错,在其他窗口没有报错
老师,我关闭了下面的代码就没有问题了,现在不知道要修改那个代码
'时钟代码
'Dim t As Date = Date.Now
'e.Form.Controls("textbox1").text = Format(t, "T")
[此贴子已经被作者于2015-1-1 22:18:52编辑过]