Click here to Skip to main content
15,896,497 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am really new to the development field, please help me in developing this logic.

Regards,
Gc
Posted
Updated 16-Mar-11 19:40pm
v2
Comments
Sergey Alexandrovich Kryukov 17-Mar-11 1:06am    
I don't want to waste time on all ListBox types. Add your tag. Windows.Forms, WPF, something else?
--SA
Gaurav.Dead 17-Mar-11 1:13am    
System.Windows.Forms.ListBox listBox1;
Sergey Alexandrovich Kryukov 17-Mar-11 1:39am    
Add to the Question **tag**. OK, I'll do it for you, next time always tag it.
The answer by Prerak is good.
--SA

1 solution

Use ListBox1.Items.IndexOf to get the index of item or ListBox1.Items.Contains to know whether item is there in listbox.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 17-Mar-11 1:28am    
Sure, a 5.
--SA
Albin Abel 17-Mar-11 1:33am    
Thats all OP needs. My 5
Prerak Patel 17-Mar-11 5:31am    
WPF?!
Tarun.K.S 17-Mar-11 5:32am    
Oops its correct! my bad!
Prerak Patel 17-Mar-11 5:41am    
No problem...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900