Hi All,
Here i am given a Code for How to delete a selected items in ListBox Control using C# in winforms
Note: Selection mode property in ListBox Control to set Multi Extended .
// Give the following Code into any Event
for(int nCount=0;nCount < listbox1.SelectedItems.Count;nCount++)
{
listbox1.Items.Remove(listbox1.SelectedItems[nCount].ToString());
nCount--;
}
Cheers :)
Posted by:
Raja
on: 9/16/2010
Level:Starter | Status: [Member] | Points: 10
You should explain the code snippet you are posting, for example you should have said here that
listbox1 is the ListBox control in the page or form, what selectedItems does. Also you should have given the code for the ListBox control. Do not just copy-paste the code that doesn't make good sense.
Hope you understand what I mean to say.
Thanks
Posted by:
T.saravanan
on: 9/17/2010
Level:Silver | Status: [Member] [MVP] | Points: 10
Hi Raja,
Thanks for your response.
Now only i am understand, you don't about .Net .
First see my category and read my code fully and then to say.
Copy and Paste is not my duty, may be you can do it. How do i know?
Cheers :)