is there a way to clear the previous contents
of this control?
along the same lines as with a textbox:
Code:text1.text = vbnullstring
Printable View
is there a way to clear the previous contents
of this control?
along the same lines as with a textbox:
Code:text1.text = vbnullstring
Do you mean:
???Code:Text1.Text = ""
MaskEdBox1.Text = ""
is this what u wanted?
Try this:
Dim Temp As String
Temp = MaskEd.Mask
MaskEd.Mask = ""
MaskEd.Text = ""
MaskEd.Mask = Temp
I use that a lot for mask edit boxes.
Or you could use a custom written control.
what exactly do you want to do?
Code:'let's say we have 4 maskedboxes using currency masks
'we can clear them this way.
Public Sub ClearAllMskEdits()
For intIncrement = 0 To Forms.Count - 1
For Each ctlMyControl In Forms(intIncrement).Controls
'
If TypeOf ctlMyControl Is MaskEdBox Then
'set the mask to nothing and then set the text to nothing
ctlMyControl.Mask = ""
ctlMyControl.Text = ""
'After clearing, you need to reset the mask to whatever it was
'for this example I will say it is ###.00
ctlMyControl.Mask = "###.00"
'
End If
'
Next ctlMyControl
'
Next intIncrement
'
End Sub
thanks everyone for the help,
this was exactly what i was looking for,
it works