General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only