Foxtable(狐表)用户栏目专家坐堂 → 遍历控件的问题


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

主题:遍历控件的问题

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


加好友 发短信
等级:幼狐 帖子:66 积分:680 威望:0 精华:0 注册:2018/2/2 1:05:00
遍历控件的问题  发帖心情 Post By:2020/3/10 17:58:00 [只看该作者]

With Tables("数据表")

 
If .Current IsNot Nothing And .Current.locked=True Then
 .Current.Locked = False

 For Each c As WinForm.Control In e.Form.Controls("Panel1")
    If Typeof c Is WinForm.TextBox Then '判断控件是否是文本框
       Dim t As WinForm.TextBox = c '使用特定类型的变量引用控件
               t.BackColor = color.white

    ElseIf  Typeof c Is WinForm.Datetimepicker Then '判断控件是否是文本框
        Dim da As winform.Datetimepicker=c
        da.BackColor = color.white

End If
Next

End If

End With

 

大神,请问为什么不能遍历某个控件中的控件呢? 有什么解决办法吗?

[此贴子已经被作者于2020/3/10 17:58:26编辑过]

 回到顶部