Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox dropdown
Message
From
30/05/2001 04:16:18
Navket Singh
TC Management Sw Pvt Ltd
Mohali, India
 
 
To
29/05/2001 22:09:31
Jordan Pastourel
Worksafe Management Systems
Toowong, Australia
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00512493
Message ID:
00512540
Views:
9
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
Previous
Reply
Map
View

Click here to load this message in the networking platform