以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  取值窗口控件  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=169694)

--  作者:qazlinle6
--  发布时间:2021/6/26 15:38:00
--  取值窗口控件
If e.Col.Name = "列名" Then
    Dim s As String = e.Row("表名") 
    If s > "" AndAlso Tables.Contains(s) Then
        Dim t As Table = Tables(s)
        s = ""
        For Each c As Col In t.Cols
            s = s & "|" & c.Name
        Next
        e.Col.ComboList = s
    End If
End If


可以像这样取值窗口控件不

--  作者:有点蓝
--  发布时间:2021/6/26 15:47:00
--  
没看到任何和窗口有关的东西。取得是列名吧
--  作者:qazlinle6
--  发布时间:2021/6/26 15:51:00
--  
If e.Col.Name = "窗口名" Then
Dim s As String
For Each frm As WinForm.Form In Forms
  s = s & "|" & frm.name
Next
e.Col.ComboList = s
    End If


可以改成
If e.Col.Name = "列名" Then
    Dim s As String = e.Row("表名") 
    If s > "" AndAlso Tables.Contains(s) Then
        Dim t As Table = Tables(s)
        s = ""
        For Each c As Col In t.Cols
            s = s & "|" & c.Name
        Next
        e.Col.ComboList = s
    End If
End If


显示控件名不

--  作者:有点蓝
--  发布时间:2021/6/26 15:57:00
--  
要想获取窗口控件
1、窗口必须处于打开状态
2、遍历获取窗口控件参考
dim s as string
For Each c As WinForm.Control In Forms("某窗口").Controls
    s = s & "|" & c.name

Next
msgbox(s)

--  作者:qazlinle6
--  发布时间:2021/6/26 16:00:00
--  
不打开取不了吗
--  作者:有点蓝
--  发布时间:2021/6/26 16:01:00
--  
取不了