以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  读取表标题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=114668)

--  作者:yifan3429
--  发布时间:2018/2/12 18:09:00
--  读取表标题
读取表标题
能够直接将表标题作为列的下拉项目吗

--  作者:有点甜
--  发布时间:2018/2/12 18:26:00
--  
Dim s As String = ""
Dim tab = basemainform.controls("mainpages")
For Each p As object In tab.tabpages
    s &= p.text & "|"
Next
Tables("表A").cols("第二列").ComboList = s.trim("|")

--  作者:yifan3429
--  发布时间:2018/2/12 19:02:00
--  
感谢老师  追问下  所有窗口呢  也想一起读出来
--  作者:有点蓝
--  发布时间:2018/2/12 20:11:00
--  
http://www.foxtable.com/webhelp/scr/0703.htm

For Each frm As WinForm.Form In Forms
    Output.Show(frm.Name)
Next

--  作者:yifan3429
--  发布时间:2018/2/13 1:52:00
--  
For Each frm As WinForm.Form In Forms
    Tables("菜单目录").cols("对应窗口").ComboList = frm.Name
Next

不能像下面一样读出所有的窗口作为列表

Dim s As String = ""
Dim tab = basemainform.controls("mainpages")
For Each p As object In tab.tabpages
    s &= p.text & "|"
Next
Tables("菜单目录").cols("对应表").ComboList = s.trim("|")

--  作者:有点甜
--  发布时间:2018/2/13 8:42:00
--  
Dim s As String = ""
For Each frm As WinForm.Form In Forms
    s &= frm.name & "|"
Next
Tables("表A").cols("第二列").ComboList = s.trim("|")

--  作者:yifan3429
--  发布时间:2018/2/23 2:43:00
--  
Dim s As String = ""
Dim tab = basemainform.controls("mainpages")
For Each p As object In tab.tabpages
    s &= p.text & "|"
Next
Tables("表A").cols("第二列").ComboList = s.trim("|")

老师您好 希望增加一个代码
一旦确认 希望将Tables("表A")的字段写入到 cols("字段")间隔符号是("|")

Dim dr As DataRow
If dr("文件名称") = e.DataTable.Name
    Dim str As String = ""
    For Each c As DataCol In e.DataTable.DataCols
        str += c.Name & "=" & e.DataRow(c.Name) & "|"
    Next
    dr("表格字段") = str
End If

以上代码无效 求助
[此贴子已经被作者于2018/2/23 2:57:39编辑过]

--  作者:有点甜
--  发布时间:2018/2/23 9:09:00
--  
Dim dr As DataRow = e.DataRow
If e.DataCol.name = "表名" Then
    Dim str As String = ""
    For Each c As DataCol In DataTables(dr("表名")).DataCols
        str += c.Name & "|"
    Next
    dr("字段") = str
End If
 

--  作者:yifan3429
--  发布时间:2018/2/28 20:03:00
--  
Dim dr As DataRow = e.DataRow
If e.DataCol.name = "表名" Then
    Dim str As String = ""
    For Each c As DataCol In DataTables(dr("表名")).DataCols
        str += c.Name & "|"
    Next
    dr("字段") = str
End If

这个是一次读取出来  我还是想成为列表选择,可以选择。和上面的窗口一样
[此贴子已经被作者于2018/2/28 20:02:57编辑过]

--  作者:有点甜
--  发布时间:2018/2/28 21:23:00
--  
不明白你的意思,请上传实例说明你的问题。