Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox dropdown
Message
De
30/05/2001 04:16:18
Navket Singh
TC Management Sw Pvt Ltd
Mohali, Inde
 
 
À
29/05/2001 22:09:31
Jordan Pastourel
Worksafe Management Systems
Toowong, Australie
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00512493
Message ID:
00512540
Vues:
11
Use The SendMessage Api Declaration to send a message to the Combo box to select the Value as u type ..
Call The Following Function in your

ComboBoxName_KeyPress() event

'-------------------- API Declaration ----------------------
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_FINDSTRING = &H14C
'-------------------- Declaration Over ---------------------

Public Function ComboShowText(C As ComboBox, KeyAscii As Integer)

Dim x As Long
Dim sStr As String

sStr = Left(C.text, C.SelStart) & Chr(KeyAscii)
x = SendMessage(C.hwnd, CB_FINDSTRING, -1, ByVal sStr)
If x >= 0 Then
C.text = C.List(x)
C.ListIndex = x
C.SelStart = Len(sStr)
C.SelLength = Len(C.text)
End If
KeyAscii = 0

End Function


'---------END------------------


Regards, Goga
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform