以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  设置下拉菜单的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=87982)

--  作者:zhangchi96
--  发布时间:2016/7/24 9:47:00
--  设置下拉菜单的问题
1、先上一个表  (第1行是列标题)

第1列     第2列    第3列   第4列   第5列  第6列   第7列  第8列   第9列
1001     科目      语文     数学    物理    化学     政治    英语     历史
1002     姓名      性别     江苏     浙江   福建     湖南    四川     上海
1003     ....
....
1010     ...

2、在窗体中插如一个控件,组合框ComboBox,定义为:Dim 省份列表 As WinForm.ComboBox = e.Form.Controls("省份") 

3、希望下拉列表样式为:(    符合条件的行是   dr(“第1列”) = ‘1002’    )

  第4列/江苏
  第5列/浙江
  第6列/福建
  第7列/湖南
  第8列/四川
  第9列/上海

敬请老师指教,代码如何编写?
 
               省份列表.ComboList = DataTables("表").?????
[此贴子已经被作者于2016/7/24 10:22:34编辑过]

--  作者:大红袍
--  发布时间:2016/7/24 10:59:00
--  

Dim fdr As DataRow = DataTables("表").Find("第1列 = \'1002\'")
Dim str As String = ""
If fdr IsNot Nothing Then
    For i As Integer = 3 To 8
        str &= Tables("表").cols(i).name & "/" & fdr(Tables("表").cols(i).name) & "|"
    Next
End If
msgbox(str.trim("|"))


--  作者:zhangchi96
--  发布时间:2016/7/24 23:09:00
--  
特别感谢!!!