I have a MaskedBox masked as ##/##/##, but I want to clear it after I use it. I've tried:
mBox.Text = ""
mBox = " / / "
mBox = "--/--/--"
mBox.Clear
But all result in errors
Printable View
I have a MaskedBox masked as ##/##/##, but I want to clear it after I use it. I've tried:
mBox.Text = ""
mBox = " / / "
mBox = "--/--/--"
mBox.Clear
But all result in errors
try this in order
VB Code:
mBox.Mask = "" mBox.Text = "" mBox.Mask = "--/--/--"
this is the code I use for both mask and text boxs
For X = 0 To Me.Controls.Count - 1
If (TypeOf Me.Controls(X) Is TextBox) Then Me.Controls(X).Text = "" Else Me.Controls(X).Text = "###-###-###"
Me.Controls(X).Enabled = False
End If
Next X
Quote:
Originally posted by mel_flynn
I have a MaskedBox masked as ##/##/##, but I want to clear it after I use it. I've tried:
mBox.Text = ""
mBox = " / / "
mBox = "--/--/--"
mBox.Clear
But all result in errors
Nice one, thanks.Code:mBox.Mask = ""
mBox.Text = ""
mBox.Mask = "##/##/##"