Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox
Message
From
22/08/2001 02:48:58
 
General information
Forum:
Visual Basic
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00546593
Message ID:
00547117
Views:
20
>>What is the way to limit the user from entering predefined number of characters in a combobox.
>>
>>I tried using API SENDMESSAGE with a constatnt CB_LIMITTEXT, but unfortunately it did not work
>>
>>Any Ideas?
>
>Is your code looks like this:
>
Option Explicit
>
>Private Declare Function SendMessage Lib "user32" _
>    Alias "SendMessageA" (ByVal hwnd As Long, _
>    ByVal wMsg As Long, ByVal wParam As Long, _
>    lParam As Any) As Long
>
>Private Const CB_LIMITTEXT = &H141
>
>Public Sub LimitCBText(CB As ComboBox, _
>   MaxLength As Long)
>
>    'usage: CB = ComboBox to limit length of
>    'MaxLength: Max characters allowed
>    'Example: LimitCBText Combo1, 5
>
>    SendMessage CB.hwnd, CB_LIMITTEXT, MaxLength, 0&
>End Sub
My mistake i was not precise, I meant DATACOMBO control.
your code works for COMBOBOX control.
System Analyst
Nabil B. Ghrayyeb
nabilg@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform