Ian96
01-20-2004, 09:12 AM
I can do this in visual basic 6 but not in vb.net agghhh
Anyways how can i add what a user has typed in a textbox to a listbox. (Add it to the listindex)
And then how can i check whether what is typed in another textbox is in the listbox then if it is a form will load up
Ian96
01-20-2004, 10:08 AM
I have to do it in vb.net because its my assignment.
Also i am trying to say this,
if txtname.text = "" then
lstname.items.add(txtname.text)
else
messagebox.show("Enter Your Name")
But it shows the messagebox only when there is something inside the textbox.
Regarding the listbox i just want it search the listbox and if what they typed into the textbox is in the listbox then it will say that the item is there
Robby
01-20-2004, 11:30 AM
try this ...
if txtname.text.length > 0 then
lstname.items.add(txtname.text)
'or if you want it to appear at the top of the listbox then
lstname.items.insert(txtname.text,0)
Ian96
01-20-2004, 04:13 PM
I know that but i want the user to type text in a text box then click a button which will read the listbox to see if it is in the listbox
Ian96
01-20-2004, 04:18 PM
I have completed it this is the code
lstuser.Items.Contains(txtusername.Text)