How to Select All Text in a Field When It Gets the Focus (153310)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q153310 SUMMARY
In many cases, it is best to select or highlight the full text of a field
when that field gains the focus. This allows the user to simply begin
typing to replace the original text with new text or to press TAB to leave
text as it is, and move to the next field. This is particularly useful in
screens where there are multiple text boxes bound to a Data control for
example.
REFERENCES
Visual Basic Language Reference, SelLength, SelStart Properties,
Pages 842-844 110394 How to Automatically Select or Highlight Text Box Upon Focus
Modification Type: | Major | Last Reviewed: | 6/24/2004 |
---|
Keywords: | kbcode KB153310 |
---|
|