VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Make A Dropdown Combo Box Auto Expandable (Only 6 Line of Code).

by Deepak Ghosh (4 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 28th June 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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).



'===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




Download this snippet    Add to My Saved Code

Make A Dropdown Combo Box Auto Expandable (Only 6 Line of Code). Comments

No comments have been posted about Make A Dropdown Combo Box Auto Expandable (Only 6 Line of Code).. Why not be the first to post a comment about Make A Dropdown Combo Box Auto Expandable (Only 6 Line of Code)..

Post your comment

Subject:
Message:
0/1000 characters