Tuesday, September 7th, 2010
Visual Basic 2008 Express – select a textbox contents
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:
- DIY Visual Basic audio player
- My love affair with Visual Basic
- Excel macro – Format By Contents
- Select a table cell contents in Word 2007
- Line feed in VBA textbox
Labels: got focus event, gotfocus, select, textbox, Visual Basic
Labels:Uncategorized
posted by Helen Bradley @ Tuesday, September 7th, 2010 0 Comments
Post a Comment
Please feel free to add your comment here. Thank you!