" Live as if you were to die tomorrow. Learn as if you were to live forever.. "
- Mahatma Gandhi

Making a TextBox autoselected in VB6

Posted on November 23rd, 2015 by Pallavi Kar

To make a TextBox automatically select its text we can have a GotFocus event handler as below: In GotFocus event of the Textbox we can have 2-3 lines of codes to make it auto select when it gets the focus. The code is shown below: Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) OR SendKeys “{home}+{end}”