Foxtable(狐表)用户栏目专家坐堂 → 控件输入


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

主题:控件输入

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/9/26 17:05:00 [显示全部帖子]

代码

 

Dim kjmc() As String '控件名称
Dim kjmcjh As String
kjmcjh = "textbox1,textbox2|textbox3" '控件名称集合
kjmc = kjmcjh.split(",")
For i As Integer = 0 To kjmc.Length - 1
    Dim cct() As String = kjmc(i).Split("|")
    If cct.Length > 1 Then
        Dim flag As String = ""
        For j As Integer = cct.Length - 1 To 0 Step -1
            flag = cct(j)
            If e.Form.Controls(flag).Text <> Nothing Then
                flag = ""
                Exit For
            End If
        Next
        If flag > "" Then
            MessageBox.Show("请输入:【" & flag & "】 !","提示", MessageBoxButtons.OK,MessageBoxIcon.Question)
        End If
    Else
        If e.Form.Controls(kjmc(i)).text = "" Then
            MessageBox.Show("请输入:【" & kjmc(i) & "】 !","提示", MessageBoxButtons.OK,MessageBoxIcon.Question)
            e.Form.Controls(kjmc(i)).Select()
            Return
        End If
    End If
Next


 回到顶部