Foxtable(狐表)用户栏目专家坐堂 → 窗口中如何引用一类控件


  共有5808人关注过本帖平板打印复制链接

主题:窗口中如何引用一类控件

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


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2013/4/19 10:09:00 [只看该作者]

For Each c As WinForm.DropDownBox In e.Form.Children
    c.Enabled = False
Next

 

For Each c As WinForm.Control In e.Form.Children

   If Typeof c Is WinForm.DropDownBox then

       c.Enabled = False

   End If
Next

 

 

 

如果用e.Form.Controls,碰到复合控件的时候,会把控件中的控件也遍历出来。

[此贴子已经被作者于2013-4-19 10:15:39编辑过]

 回到顶部