When you hand control back to a textbox in Visual Basic it’s useful if you also select the textbox contents so a user can just start typing over the current contents. Here’s how to do this – place the code in the Textbox_gotfocus event handler:

TextBox.SelectionStart = 0
TextBox.SelectionLength = Len(TextBox.Text)

How easy is that?

Related posts:

  1. DIY Visual Basic audio player
  2. My love affair with Visual Basic
  3. Excel macro – Format By Contents
  4. Select a table cell contents in Word 2007
  5. Line feed in VBA textbox