I can't seem to figure this out-

I have a single text box that has text in it. When I put the mouse in it and click it, I need the text to clear so new text can go in.

Does anyone have a sample?


TIA

Recommended Answers

Hi,

You can do it like this:

Private Sub TextBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseDown
        TextBox1.Text = ""
    End Sub
Jump to Post

All 3 Replies

Hi,

You can do it like this:

Private Sub TextBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseDown
        TextBox1.Text = ""
    End Sub

Thanks a lot- that was pretty simple.

thanksssss

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.