تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
سؤال حول البحث في combobox
#2
إجعل الـ Style للكومبو هي 0 (DropDown Combo)

في الـ 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
الرد }}}
تم الشكر بواسطة: Ahmed_Mansoor , sendbad100 , Amir_Alzubidy


الردود في هذا الموضوع
سؤال حول البحث في combobox - بواسطة tighrmte - 24-01-19, 02:31 AM
RE: سؤال حول البحث في combobox - بواسطة عبدالله الصافي - 24-01-19, 05:43 AM
RE: سؤال حول البحث في combobox - بواسطة tighrmte - 27-01-19, 03:28 PM


التنقل السريع :


يقوم بقرائة الموضوع: