Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
GeneralRe: i wait so much because of loops Pin
Luc Pattyn4-May-10 4:18
sitebuilderLuc Pattyn4-May-10 4:18 
QuestionMissing special symbols Pin
Sebastian T Xavier3-May-10 1:29
Sebastian T Xavier3-May-10 1:29 
AnswerRe: Missing special symbols PinPopular
Alan N3-May-10 2:24
Alan N3-May-10 2:24 
QuestionRemove items from the list box in C# windows application Pin
yadlaprasad3-May-10 0:31
yadlaprasad3-May-10 0:31 
AnswerRe: Remove items from the list box in C# windows application Pin
Abhinav S3-May-10 0:49
Abhinav S3-May-10 0:49 
AnswerRe: Remove items from the list box in C# windows application Pin
nagendrathecoder3-May-10 0:52
nagendrathecoder3-May-10 0:52 
AnswerRe: Remove items from the list box in C# windows application Pin
Abdul Rahman Hamidy3-May-10 0:53
Abdul Rahman Hamidy3-May-10 0:53 
AnswerRe: Remove items from the list box in C# windows application Pin
Henry Minute3-May-10 3:32
Henry Minute3-May-10 3:32 
All that your code does is to remove an item from the SelectedItems collection of your ListBox (i.e. you are unselecting it), not from the ListBox itself.

To remove/delete from the listbox replace

Lstservices.SelectedItems.Remove(Lstservices.SelectedItem);


with

Lstservices.Items.Remove(Lstservices.SelectedItem);


but bear in mind that, as someone else has mentioned, C# will complain if you try this whilst iterating over the collection.
Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

AnswerRe: Remove items from the list box in C# windows application Pin
PIEBALDconsult3-May-10 4:44
mvePIEBALDconsult3-May-10 4:44 
QuestionHtmlAgilityPack Weirdness Pin
#realJSOP3-May-10 0:10
mve#realJSOP3-May-10 0:10 
AnswerRe: HtmlAgilityPack Weirdness Pin
Ravi Bhavnani3-May-10 2:42
professionalRavi Bhavnani3-May-10 2:42 
AnswerRe: HtmlAgilityPack Weirdness Pin
Luc Pattyn3-May-10 2:47
sitebuilderLuc Pattyn3-May-10 2:47 
AnswerRe: HtmlAgilityPack Weirdness Pin
Pete O'Hanlon3-May-10 2:50
mvePete O'Hanlon3-May-10 2:50 
GeneralRe: HtmlAgilityPack Weirdness Pin
#realJSOP3-May-10 5:54
mve#realJSOP3-May-10 5:54 
GeneralRe: HtmlAgilityPack Weirdness Pin
Luc Pattyn3-May-10 6:09
sitebuilderLuc Pattyn3-May-10 6:09 
GeneralRe: HtmlAgilityPack Weirdness Pin
#realJSOP3-May-10 6:46
mve#realJSOP3-May-10 6:46 
GeneralRe: HtmlAgilityPack Weirdness Pin
Luc Pattyn3-May-10 6:57
sitebuilderLuc Pattyn3-May-10 6:57 
GeneralRe: HtmlAgilityPack Weirdness Pin
#realJSOP3-May-10 13:47
mve#realJSOP3-May-10 13:47 
GeneralRe: HtmlAgilityPack Weirdness Pin
Luc Pattyn3-May-10 13:59
sitebuilderLuc Pattyn3-May-10 13:59 
GeneralRe: HtmlAgilityPack Weirdness Pin
#realJSOP3-May-10 23:23
mve#realJSOP3-May-10 23:23 
GeneralRe: HtmlAgilityPack Weirdness [modified] Pin
#realJSOP4-May-10 0:09
mve#realJSOP4-May-10 0:09 
QuestionHow to license my product Pin
Jamal Abdul Nasir3-May-10 0:08
Jamal Abdul Nasir3-May-10 0:08 
AnswerRe: How to license my product Pin
Peace ON3-May-10 0:51
Peace ON3-May-10 0:51 
GeneralRe: How to license my product Pin
Jamal Abdul Nasir3-May-10 5:36
Jamal Abdul Nasir3-May-10 5:36 
GeneralRe: How to license my product Pin
Peace ON3-May-10 21:01
Peace ON3-May-10 21:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.