Data in the TextBox with different mask

I want that some textbox(TextBox1) will consist ,for example,any number .And when the form is loading,
this number in the TextBox1 will be paint in "blue"
Like,we want to erase it .
How can I do this?

Who is Participating?
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
Add this code to the GotFocus event

Private Sub Text1_GotFocus()
    With Text1
        .SelStart = 0
        .SelLength = Len(.Text)
    End With
End Sub
try this
Private Sub Form_Load()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
The above example assumes that the textbox will have the focus when the form loads.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.