VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Highlight Entire Textbox

by Alex Fredricks (4 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (6 Votes)

Highlight textbox/combobox and its entire contents. Simple but cosmetically useful.

Rate Highlight Entire Textbox

Public Sub Focus(varX As Variant)
'selects entire txtbox
 With varX
  If .Text <> "" Then
   .SelStart = 0
   .SelLength = Len(.Text)
  End If
 End With
End Sub

''''''''''''''''''''''''''''''''''''
call statement
''''''''''''''''''''''''''''''''''''
Private Sub txtStoreNo_GotFocus()
 Focus txtstoreno
End Sub

Download this snippet    Add to My Saved Code

Highlight Entire Textbox Comments

No comments have been posted about Highlight Entire Textbox. Why not be the first to post a comment about Highlight Entire Textbox.

Post your comment

Subject:
Message:
0/1000 characters