以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  遍历控件的时候,如何才能按设置的tab键的顺序遍历?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=117672)

--  作者:ap9709130
--  发布时间:2018/4/17 14:05:00
--  遍历控件的时候,如何才能按设置的tab键的顺序遍历?
老师

如题.

--  作者:有点甜
--  发布时间:2018/4/17 14:19:00
--  

Dim dics As new SortedDictionary(Of Integer, object)
For Each c As object In e.form.controls
    dics.Add(c.tabindex, c)
Next
For Each key As Integer In dics.keys
    msgbox(dics(key).name)
Next


--  作者:ap9709130
--  发布时间:2018/4/17 14:37:00
--  
多谢!
--  作者:ap9709130
--  发布时间:2018/4/17 15:21:00
--  
老师

如果用Select Case想判断控件是种,要怎么写?

Select Case Typeof e.Form.Controls(dics(key).name) 



--  作者:有点甜
--  发布时间:2018/4/17 15:26:00
--  

Dim dics As new SortedDictionary(Of Integer, object)
For Each c As object In e.form.controls
    dics.Add(c.tabindex, c)
Next
For Each key As Integer In dics.keys

    msgbox(dics(key).gettype.name)
    Select Case dics(key).Gettype.name
        Case "Button"

 

        Case "TextBox"

 

    end select
Next