Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox
Message
De
22/08/2001 02:48:58
 
Information générale
Forum:
Visual Basic
Catégorie:
Fonctions API de Windows
Titre:
Divers
Thread ID:
00546593
Message ID:
00547117
Vues:
13
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform