04-04-14, 01:26 PM
كود :
Friend Class Form1
Inherits System.Windows.Forms.Form
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As AnchorStyles) As Integer
'____________________________________________________
Public Sub ComboBoxSpeedFill(ByRef cmboBox As System.Windows.Forms.ComboBox)
Dim rtn, lngPos As Integer
With cmboBox
lngPos = Len(.Text)
If lngPos <> 0 Then
rtn = SendMessage(.Handle.ToInt32, &H14C, -1, .Text)
.SelectedIndex = rtn
.SelectionStart = lngPos
.SelectionLength = Len(.Text) - lngPos
End If
End With
End Sub
Private Sub Combo1_KeyUp(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyEventArgs) Handles Combo1.KeyUp
Dim KeyCode As Short = eventArgs.KeyCode
Dim Shift As Short = eventArgs.KeyData \ &H10000
Select Case KeyCode
Case 32, &H30 To &H6F, Is > &H7F
ComboBoxSpeedFill(Combo1)
End Select
End Sub
Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
Combo1.Items.Insert(0, "جاسم عبد")
Combo1.Items.Insert(1, "ناجي ابراهيم")
Combo1.Items.Insert(2, "تركي الحلواني")
Combo1.Items.Insert(3, "الاصيله")
Combo1.Items.Insert(4, "ابو هديل")
Combo1.Items.Insert(5, "ابو رائد")
End Sub
End Class[/align]