Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:历遍控件类型与select case

1楼
lur320 发表于:2023/12/18 15:11:00
  For Each c As WinForm.Control In e.Form.Controls
        Select Case TypeOf c
            Case WinForm.TextBox
            Dim t As WinForm.TextBox = c '使用特定类型的变量引用控件
            t.Value = Nothing
        End Select
       ‘’‘ If TypeOf c Is WinForm.TextBox Then '判断控件是否是文本框
         ’‘’‘   Dim t As WinForm.TextBox = c '使用特定类型的变量引用控件
         ’‘’‘   t.Value = Nothing
     ’‘’‘   End If
    Next

控件比较多,有没有用select case 来编写历遍控件和判断控件类型的方法?
2楼
有点蓝 发表于:2023/12/18 15:16:00
只能使用if判断
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 2 queries.