24-01-19, 05:43 AM
إجعل الـ Style للكومبو هي 0 (DropDown Combo)
في الـ General أضف
استخدم تلك الاكواد
ةايضا ذلك الكود
في الـ General أضف
كود :
Dim blnBackSpace as Boolleanاستخدم تلك الاكواد
كود :
Private Sub combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyBack Or KeyCode = vbKeyDelete Then blnBackSpace = True
End Subكود :
Private Sub combo1_Change()
Dim i As Long
Dim lngText As Long
If combo1.Text = vbNullString Then
blnBackSpace = False
Exit Sub
End If
'----------------------
For i = 0 To combo1.ListCount - 1
If InStr(1, combo1.List(i), combo1.Text, vbTextCompare) = 1 Then
If blnBackSpace = True Then
lngText = combo1.SelStart - 1
blnBackSpace = False
Else
lngText = combo1.SelStart
End If
combo1.Text = combo1.List(i)
'----------------Add--Your-Action-Here---------
'---------------------------------------------------
combo1.SelStart = lngText
combo1.SelLength = Len(combo1.Text) - lngText
Exit For
End If
If i = combo1.ListCount - 1 Then combo1 = ""
Next

