--
以下是我写的代码:
Dim lst1 As WinForm.ListBox = e.Form.Controls("ListBox1")
Dim lst2 As WinForm.ListBox = e.Form.Controls("ListBox2")
Dim str As String = ""
For Each dt As DataTable In DataTables
If dt.name <> "Main" And dt.name <> "统计出现次数_Table1" And dt.name <> "Frequence" And dt.name <> "Frequence2" And dt.name <> "Frequence3" And dt.name <> "Frequence4" And dt.name <> "Frequence5" Then
If dt.name <> "UFrequence" And dt.name <> "UFrequence2" And dt.name <> "UFrequence3" And dt.name <> "UFrequence4" And dt.name <> "UFrequence5" Then
If dt.name <> "UConsequence" And dt.name <> "UConsequence2" And dt.name <> "UConsequence3" And dt.name <> "UConsequence4" And dt.name <> "UConsequence5" Then
If dt.name <> "Consequence" And dt.name <> "Consequence2" And dt.name <> "Consequence3" And dt.name <> "Consequence4" And dt.name <> "Consequence5" Then
If dt.name <> "users" And dt.name <> "可能性" And dt.name <> "严重度" And dt.name <> "风险矩阵" And dt.name <> "风险值" Then
str &= dt.name & "|"
End If
End If
End If
End If
End If
Next
Dim cmd As WinForm.Listbox = e.Form.controls("listbox1")
cmd.ComboList = str.trim("|")
str = lst1.items(1)
lst2.Items.Clear
For Each c As Col In Tables(str).cols
lst2.items.Add(c.name)
Next