• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

textbox on tab select entire text

vb 2005

when i tab through textboxes, i'd like to have the whole text in the textbox selected when it gets focus.

thanks
0
newyuppie
Asked:
newyuppie
  • 2
1 Solution
 
Fernando SotoCommented:
Hi newyuppie;

Place an event handler for the TextBox Get Focus event and attach all text boxes to it and inset the line of code below.

    Private Sub TextBox_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) _
        Handles TextBox1.GotFocus, TextBox2.GotFocus, TextBox3.GotFocus

        CType(sender, TextBox).SelectAll()

    End Sub


Fernando
0
 
newyuppieAuthor Commented:
very good that works fine. thank you!
0
 
Fernando SotoCommented:
Glad I was able to help. :=)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now