全局代码
Public Sub cmb_TextChanged(sender As Object,e As EventArgs)
Dim lbox = sender.parent.parent.panel2.Controls("lstFields")
lbox.Items.Clear
Dim tname = sender.Text.Split(" ")(0)
If DataTables.contains(tname) Then
lbox.Items.Add(tname)
For i As Integer = 1 To DataTables(tname).DataCols.Count
Dim dc = DataTables(tname).DataCols(i - 1)
lbox.Items.Add(dc.Name)
Next
lbox.Items.Add("----------------")
lbox.Items.Add(tname & " " & DataTables(tname).Caption)
For i As Integer = 1 To DataTables(tname).DataCols.Count
Dim dc = DataTables(tname).DataCols(i - 1)
lbox.Items.Add(dc.Name & " " & dc.Caption)
Next
End If
End Sub
------------------------
计划管理
Dim frm = Windows.Forms.Form.ActiveForm
If frm IsNot Nothing Then
If frm.Name = "Class197" OrElse frm.name = "Class260" Then
Dim cmb
If frm.name = "Class197" Then
cmb = frm.Controls("SplitContainer1").Panel1.Controls("MyCodeEditor21").Controls("SplitContainer1").Panel2.Controls("C1DockingTab1").Controls("FieldsPage").Controls("SplitContainer4").panel1.controls("cmbDataTables")
Else
cmb = frm.Controls("MyCodeEditor1").Controls("SplitContainer1").Panel2.Controls("C1DockingTab1").Controls("FieldsPage").Controls("SplitContainer4").panel1.controls("cmbDataTables")
End If
cmb.Visible = False
Dim ncmb As Windows.Forms.ComboBox
If cmb.parent.Controls.count > 1 Then
ncmb = cmb.parent.Controls(1)
output.show(2)
Else
output.show(3)
ncmb = new Windows.Forms.ComboBox
ncmb.Dock = 5
ncmb.Visible = True
cmb.parent.Controls.Add(ncmb)
ncmb.Items.Clear
For Each dt As DataTable In DataTables
ncmb.items.Add(dt.Name & " " & dt.Caption)
Next
addhandler ncmb.TextChanged, addressof cmb_TextChanged
End If
End If
End If