Make A Dropdown Combo Box Auto Expandable (Only 6 Line of Code).
Make A Dropdown Combo Box Auto Expandable (Only 6 Line of Code).
Rate Make A Dropdown Combo Box Auto Expandable (Only 6 Line of Code).
(1(1 Vote))
'===Hope You will like this Code.
'Create A DropDown Combo Box by the Name of Combo1 and Paste The Following Code.
'Remove 'Option Explicit' from the top.
'This is applicable for only Dropdown Combo Box not Dropdown List Combo Box.
'======================================================================
Private Sub Combo1_KeyUp(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If Len(Combo1) = 0 Or KeyCode = 8 Then Exit Sub
Y = Len(Combo1)
For X = 0 To Combo1.ListCount - 1
If UCase(Left(Combo1.List(X), Y)) = UCase(Combo1) Then Combo1 = Combo1.List(X)
Next
Combo1.SelStart = Y: Combo1.SelLength = Len(Combo1) - Y
End Sub
Private Sub Form_Load()
Combo1.AddItem "Deepak Ghosh"
Combo1.AddItem "Tom Hanks"
Combo1.AddItem "John Travolta"
Combo1.AddItem "Tom Cruise"
Combo1.AddItem "Silvestar Stalone"
End Sub
Make A Dropdown Combo Box Auto Expandable (Only 6 Line of Code). Comments
No comments yet — be the first to post one!
Post a Comment