Foxtable(狐表)用户栏目专家坐堂 → [求助]保存前验证所有 TextBox 不能为空白


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

主题:[求助]保存前验证所有 TextBox 不能为空白

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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2015/6/26 15:05:00 [显示全部帖子]

For Each c As WinForm.Control In e.Form.Controls
    If
 Typeof c Is WinForm.TextBox Then '判断是否是文本框
        
Dim t As WinForm.TextBox = c '使用特定类型的变量引用
          if t.text = "" then
       e.cancel=true
       return
     end if
  End
 If
Next

 回到顶部