(winforms)how to clear the listbox items

Posted by Kishore under C# on 2/28/2010 | Views : 7957 | Status : [Member] | Replies : 4
hi
i want to clear the all items in the listbox , i know one logic that is

listbox1.items.clear();

but i need another way to clear the listbox items, plz help ?




Responses

Posted by: Rajujrk on: 2/28/2010 [Member] Starter

Up
0
Down
hai kishore,

First you say what you need based one your task...

there having lot of alternative ways to clear the listbox..


Thanks & Regards

Rajkumar J

Kishore, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi2434 on: 3/1/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
What way you need ?

listbox1.Items.Clear(), listbox1.Items.Remove() etc are there to remove. Clear removes all items, Remove clears only the item you pass.

what you require ?

www.abhisheksur.com

Kishore, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi2434 on: 3/1/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
What way you need ?

listbox1.Items.Clear(), listbox1.Items.Remove() etc are there to remove. Clear removes all items, Remove clears only the item you pass.

what you require ?

www.abhisheksur.com

Kishore, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kishore on: 3/1/2010 [Member] Starter

Up
0
Down
my question is to remove all the listbox items without using the clear() method ?

Kishore, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response