VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Auto-Select Text on Focus

by Delio Castillo (1 Submission)
Category: String Manipulation
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (10 Votes)

Nice feature to help users edit textboxes. The code selects all the existing text when the users focus on the textbox control. This will definitely make your application more user friendly. Please Vote!!!

Inputs
Textbox Name
Assumes
Copy this sub on your code and then use the textbox name as a parameter when you call the sub. When I use it, I usually call the SUB on the GotFocus event.

Rate Auto-Select Text on Focus

Public Sub Select_Text(TextBoxName As Variant)
  TextBoxName.SelStart = 0
  TextBoxName.SelLength = Len(TextBoxName.Text)
End Sub

Download this snippet    Add to My Saved Code

Auto-Select Text on Focus Comments

No comments have been posted about Auto-Select Text on Focus. Why not be the first to post a comment about Auto-Select Text on Focus.

Post your comment

Subject:
Message:
0/1000 characters