Mask edit box

abtm

New member
Joined
Nov 30, 2006
Messages
4
Location
Portugal
Programming Experience
1-3
Hi! i'm trying to select all text in a mask edit box when focus so that the user can change the default text (today's date). The select doesn't work and selectall is not a member of the maskbox. Does anyone know how to solve it? Thanks.
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,553
Location
Norway
Programming Experience
10+
The MaskEdBox control in Visual Basic 6.0 is replaced by the Windows Forms MaskedTextBox control in Visual Basic 2005.
MaskedTextBox got .Select and .SelectAll methods inherited from TextBoxBase, so this code works fine:
VB.NET:
    Private Sub MaskedTextBox1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) _
    Handles MaskedTextBox1.Enter
        MaskedTextBox1.SelectAll()
    End Sub
 
Top Bottom