Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleMake a TextBox automatically capitalize input
Keywordsuppercase, upper case, capitalize, TextBox, input
CategoriesControls
 
Make the TextBox's Change event handler capitalize the text. Save and restore the SelStart property so resetting the value does not move the insertion position.
 
Private Sub Text1_Change()
Dim old_pos As Integer

    old_pos = Text1.SelStart
    Text1.Text = UCase(Text1.Text)
    Text1.SelStart = old_pos
End Sub
 
Formatted by Neil Crosby
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated