Процедура автопоиска:
- Код: Выделить всё
Public Sub AutoFillCombo(Combo As ComboBox)
Dim i&, P&, vTxt As String
valComboStr = False
i = SendMessage(Combo.hWnd, CB_FINDSTRING, -1, ByVal Combo.text) + 1
If i > 0 Then
P = Combo.SelStart
Combo.ListIndex = i - 1
Combo.SelStart = P
Combo.SelLength = Len(Combo.text) - P
valComboStr = False
Else
valComboStr = True
End If
End Sub
Private LastComboKeyAscii&
Sub ChangeCombo(ChCombo As ComboBox)
Dim i&, objCB As CCombo
Set objCB = New CCombo
If Not (LastComboKeyAscii = 8) And Not (LastComboKeyAscii = 46) Then
Call objCB.AutoFillCombo(ChCombo)
LastComboKeyAscii = 0
Call objCB.SearchInCombo(ChCombo)
Else
Call objCB.SearchInCombo(ChCombo)
End If
Set objCB = Nothing
Verif_Edit
End Sub
Спасибо за ответы!
P.s.: Очень актуально для меня и нужно вчера...