Programming » Visual Basic 6 » Visual Basic 6 Code » Controls » Combobox » ");?>
Limit the amount of text entered into a combobox. Much like the Textbox's MaxLength property.
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
        (ByVal hwnd As LongByVal wMsg As Long, _
        ByVal wParam As Long, lParam As Any) As Long

Private Const CB_LIMITTEXT = &H141

Private Sub LimitComboText(cbo As ComboBox, lngLength As Long)
    SendMessage cbo.hwnd, CB_LIMITTEXT, lngLength, 0&
End Sub