Re: Clearing Mask Edit box
Kelly:
Instead of setting the mask = "" set it = " "
example:
Public Sub ClearTextBoxes(ByVal cntl As Control)
Dim cntl1 As Control
For Each cntl In cntl.Controls
If (TypeOf (cntl) Is TextBox) Then
CType(cntl, TextBox).Clear()
ElseIf (TypeOf (cntl) Is AxMSMask.AxMaskEdBox) Then
CType(cntl, AxMSMask.AxMaskEdBox).Mask = " "
CType(cntl, AxMSMask.AxMaskEdBox).Text = ""
If InStr(cntl.Tag, "date") > 0 Then CType _ (cntl,AxMSMask.AxMaskEdBox).Mask
= "##\/##\/##"
If InStr(cntl.Tag, "phone") > 0 Then CType _(cntl,AxMSMask.AxMaskEdBox).Mask
= "\(###\) ###\-####"
ElseIf (TypeOf (cntl) Is ComboBox) And cntl.Tag <> "Master" Then
CType(cntl, ComboBox).Text = ""
CType(cntl, ComboBox).SelectedIndex = -1
ElseIf (TypeOf (cntl) Is CheckBox) Then
CType(cntl, CheckBox).Checked = False
End If
Next cntl
End Sub
Re: Clearing Mask Edit box
Hey Kevin,
Thanks this what I was looking for...
Kelly
"Kevin" <kswiber@hotmail.com> wrote:
>
>Kelly:
>
>Instead of setting the mask = "" set it = " "
>
>example:
>
> Public Sub ClearTextBoxes(ByVal cntl As Control)
> Dim cntl1 As Control
> For Each cntl In cntl.Controls
> If (TypeOf (cntl) Is TextBox) Then
> CType(cntl, TextBox).Clear()
> ElseIf (TypeOf (cntl) Is AxMSMask.AxMaskEdBox) Then
> CType(cntl, AxMSMask.AxMaskEdBox).Mask = " "
> CType(cntl, AxMSMask.AxMaskEdBox).Text = ""
> If InStr(cntl.Tag, "date") > 0 Then CType _ (cntl,AxMSMask.AxMaskEdBox).Mask
>= "##\/##\/##"
> If InStr(cntl.Tag, "phone") > 0 Then CType _(cntl,AxMSMask.AxMaskEdBox).Mask
>= "\(###\) ###\-####"
> ElseIf (TypeOf (cntl) Is ComboBox) And cntl.Tag <> "Master" Then
> CType(cntl, ComboBox).Text = ""
> CType(cntl, ComboBox).SelectedIndex = -1
> ElseIf (TypeOf (cntl) Is CheckBox) Then
> CType(cntl, CheckBox).Checked = False
> End If
> Next cntl
> End Sub