Today I am going to show you how to make a simple SearchList using VB 6 .. :)
Ok .. all you need is a form .. a TextBox .. a button and a ListBox ..
the SearchList will look like this:
[ATTACH]1261[/ATTACH]
Ok than .. rename the button to "Search" first ..
and than add this code to the button ..
Dim theList As Long Dim textToSearch As String Dim theListText As String textToSearch = LCase(Text1.Text) For theList = 0 To List1.ListCount - 1 theListText = LCase(List1.List(theList)) If theListText = textToSearch Then List1.Text = textToSearch Next End Suband than after this .. add:
Private Sub Form_Load() List1.AddItem "Code" List1.AddItem "CodeCall" List1.AddItem "Member" List1.AddItem "Admin" List1.AddItem "Mod" End Subthis is the list that loads the items to the listbox on Application StartUp ..
now .. if you search for one the items on the list ..that item will be selected ..
...
and now .. a test ..
[ATTACH]1260[/ATTACH]
Thanks, Egz0N .. :)
Attached Files
Edited by Jordan, 15 January 2009 - 06:44 AM.


Sign In
Create Account





Back to top










