-1

我的表单中有五个蒙面文本框。两个带日期格式的蒙版文本框,两个带钱,一个带电话号码。我正在使用下面给出的代码来检查这些框是否为空。

    Dim mtxt As Control
    Dim flagmtxt As Boolean
    flagmtxt = False
    For Each mtxt In EMPGBDATA.Controls
        If TypeOf mtxt Is MaskedTextBox Then
            If mtxt.Text = "" Then
                mtxt.BackColor = Color.Red
                flagmtxt = True
            End If
        End If
    Next

    If flagmtxt Then
        MessageBox.Show("Give Compleate Data!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
    End If

我想避免检查带有工资格式的蒙面文本框。有机会吗??

4

1 回答 1

0
flagmtxt = False
    For Each mtxt In EMPGBDATA.Controls
        If TypeOf mtxt Is MaskedTextBox Then
            If mtxt.Text = "" And mtxt.Name <> "MTXTPFESI" Then
                flagmtxt = True
            Else
                flagmtxt = False
            End If
        End If
    Next
于 2013-01-11T12:44:14.797 回答