用窗口中的组合框选定当前表,表控件动态显示当前表的指定列,帮忙看看哪里不对?
1、'窗口的afterload事件
Dim bm As String '获取表名下拉框
For Each dt As DataTable In DataTables
If bm ="" Then
bm = dt.Name
Else
bm = bm & "|" & dt.Name
End If
Next
Dim cmb As WinForm.ComboBox = e.form.Controls("ComboBox1")
cmb.ComboList = bm
---------------------------------
2、'组合框的TextChanged事件
If Tables.Contains(e.Sender.Text) Then '该表作为选中表
Dim t As Table = Tables(e.Sender.text)
MainTable = t
t.Focus
Tables("窗口1_Table1").DataSource = t
Tables("窗口1_Table1").SetColVisibleWidth("第一列|90|第二列|120")
End If
此主题相关图片如下:gif.gif

附件:
[此贴子已经被作者于2017/4/10 22:15:04编辑过]