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
 
 
 
 
TitleLimit the text in TextBoxes and ComboBoxes
KeywordsTextBox, ComboBox, limit text
CategoriesControls
 
Use the SendMessage API function to send the controls the EM_LIMITTEXT and CB_LIMITTEXT messages.
 
Private Sub Form_Load()
    SendMessage Text1.hwnd, _
        EM_LIMITTEXT, 4, 0
    SendMessage Combo1.hwnd, _
        CB_LIMITTEXT, 4, 0

    SendMessage Text2.hwnd, _
        EM_LIMITTEXT, 8, 0
    SendMessage Combo2.hwnd, _
        CB_LIMITTEXT, 8, 0
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated