

ID: 461
Viewed: 3662
Added: Aug 19, 2002
Version:



Snippet uploaded by: snippet
Written By: Unknown
Demo: Sorry, no demo



Thank you for your vote. Please wait...
It appears you already voted for this snippet
It appears your vote value was empty


When using edit boxes, it is often useful to generate automatic selection of
text for your users when the control gets focus. This makes it easy to
overwrite the text. You can do this easily by adding a couple of lines to the
GotFocus event procedure:
Notice that the length value for SelLength is 65535, the maximum length allowed in a Text Box. This forces Visual
Basic to use the actual length of the text as the SelLength.
text for your users when the control gets focus. This makes it easy to
overwrite the text. You can do this easily by adding a couple of lines to the
GotFocus event procedure:
Notice that the length value for SelLength is 65535, the maximum length allowed in a Text Box. This forces Visual
Basic to use the actual length of the text as the SelLength.
Highlight all by clicking in box
<!---Declaration--->
none
Highlight All
<!---Code--->
Sub Text1_GotFocus ()
Text1.SelStart = 0
Text1.SelLength = 65535
End Sub;
No Comments to show


Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.