Foxtable(狐表)用户栏目专家坐堂 → 窗口数据合计


  共有2494人关注过本帖树形打印复制链接

主题:窗口数据合计

帅哥哟,离线,有人找我吗?
有点甜
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/5/25 12:12:00 [只看该作者]

Dim str as string = ""
Dim dics As new SortedDictionary(Of String, object)
For Each c As object In e.form.controls
    dics.Add(c.name, c)
Next
For Each key As Integer In dics.keys
    Dim cc = dics(key)
    If Typeof cc Is WinForm.ComboBox Then '判断控件是否是文本框
        Dim t As WinForm.ComboBox = cc '使用特定类型的变量引用控件
        If t.Name.EndsWith("_tbx") AndAlso t.Text > ""
            str = str & e.Form.controls(t.Name.Split("_")(0) & "_lb").text & t.Text & ","
            'sum += val(t.Text)
        End If
    End If   
Next
msgbox(str)

 

如果有问题,具体项目也发上来测试。


 回到顶部
帅哥哟,离线,有人找我吗?
ZJZK2018
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:767 积分:6119 威望:0 精华:0 注册:2018/2/1 17:26:00
  发帖心情 Post By:2018/5/25 12:24:00 [只看该作者]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:pppppppp.foxdb



图片点击可在新窗口打开查看此主题相关图片如下:ddd.png
图片点击可在新窗口打开查看

[此贴子已经被作者于2018/5/25 12:24:58编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/5/25 14:45:00 [只看该作者]

Dim str As String
Dim dics As new SortedDictionary(Of String, object)
For Each c As object In e.form.controls
    dics.Add(c.name, c)
Next
For Each key As String In dics.keys
    Dim cc = dics(key)
    If Typeof cc Is WinForm.ComboBox Then '判断控件是否是文本框
        Dim t As WinForm.ComboBox = cc '使用特定类型的变量引用控件
        If t.Name.EndsWith("_tbx") AndAlso t.Text > ""
            str = str & e.Form.controls(t.Name.Split("_")(0) & "_lb").text & t.Text & ","
            'sum += val(t.Text)
        End If
    End If   
Next
msgbox(str)

 回到顶部
帅哥哟,离线,有人找我吗?
ZJZK2018
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:767 积分:6119 威望:0 精华:0 注册:2018/2/1 17:26:00
  发帖心情 Post By:2018/5/25 15:04:00 [只看该作者]

有点甜老师:

我的需求是:根据控件的Tab键的顺序号进行排列,上面这代码还是没有按顺序号进行排列,如何处理?谢谢


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/5/25 15:55:00 [只看该作者]

Dim str As String
Dim dics As new SortedDictionary(Of Integer, object)
For Each c As object In e.form.controls
    If c.Name.EndsWith("_tbx") Then
        dics.Add(c.tabindex, c)
    End If
Next
For Each key As Integer In dics.keys
    Dim cc = dics(key)
    If Typeof cc Is WinForm.ComboBox Then '判断控件是否是文本框
        Dim t As WinForm.ComboBox = cc '使用特定类型的变量引用控件
        If t.Name.EndsWith("_tbx") AndAlso t.Text > ""
            str = str & e.Form.controls(t.Name.Split("_")(0) & "_lb").text & t.Text & ","
            'sum += val(t.Text)
        End If
    End If
Next
msgbox(str)

 回到顶部
总数 15 上一页 1 2