To find item from list box (Like Font Dialog Box)
To find item from list box (Like Font Dialog Box)
Rate To find item from list box (Like Font Dialog Box)
(2(2 Vote))
'Place a List box on form
'Apply the following code
'
Private Sub Form_Load()
a = 1
While (a <= 12)
List1.AddItem Mid(Format("1/" & a & "/2002", "dd-Mmm-yy"), 4, 3)
a = a + 1
Wend
End Sub
Private Sub Text1_Change()
On Error GoTo err
If (Text1.Text = "") Then
List1.Selected(a) = False
GoTo err
End If
a = List1.ListCount
While (a >= 0)
If (Text1.Text = Left(List1.List(a), Len(Text1.Text))) Then
List1.Selected(a) = True
End If
a = a - 1
Wend
err:
Resume Next
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii = 13) Then
'It will display full name in text box
Text1.Text = List1.Text
End If
End Sub
To find item from list box (Like Font Dialog Box) Comments
No comments yet — be the first to post one!
Post a Comment