Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
AnswerRe:C# Pin
Girish6018-Aug-06 0:15
Girish6018-Aug-06 0:15 
AnswerRe: C# Pin
Ramasubramaniam12-Aug-06 4:23
Ramasubramaniam12-Aug-06 4:23 
Questionhelp in moving dial knob with mouse [modified] Pin
codeprojecti7-Aug-06 23:24
codeprojecti7-Aug-06 23:24 
QuestionSending mail with attachment Pin
seee sharp7-Aug-06 23:14
seee sharp7-Aug-06 23:14 
AnswerRe: Sending mail with attachment Pin
Ramasubramaniam8-Aug-06 10:39
Ramasubramaniam8-Aug-06 10:39 
Questionweird behavior when removing controls :S Pin
kkadir7-Aug-06 22:42
kkadir7-Aug-06 22:42 
AnswerRe: weird behavior when removing controls :S Pin
Corinna John8-Aug-06 1:10
Corinna John8-Aug-06 1:10 
AnswerRe: weird behavior when removing controls :S [modified] Pin
Colin Angus Mackay8-Aug-06 1:47
Colin Angus Mackay8-Aug-06 1:47 
pashje wrote:
but its the same sh*t. Mad | :mad:


Rather than get angry with the world perhaps you should read the documentation. It says that you should not alter the thing your are iterating over from within a foreach loop. The reason is that the results are unpredictable.

If you want to remove all the controls in a panel then why not do something like this:
panel3.Controls.Clear()


If you want to do other stuff as you remove them then something like this would work:
while(panel3.Controls.Count > 0)
{
    Control c = panel3.Controls[0];
    c.Dispose();
    panel3.Controls.RemoveAt(0);
}


-- modified at 7:48 Tuesday 8th August, 2006


GeneralRe: weird behavior when removing controls :S Pin
kkadir8-Aug-06 3:42
kkadir8-Aug-06 3:42 
QuestionAbout assemblies Pin
nesaraja7-Aug-06 21:08
nesaraja7-Aug-06 21:08 
AnswerRe: About assemblies Pin
albCode7-Aug-06 22:23
albCode7-Aug-06 22:23 
GeneralRe: About assemblies Pin
nesaraja7-Aug-06 22:59
nesaraja7-Aug-06 22:59 
QuestionHelp in TCP Connection Pin
Kamleshs7-Aug-06 20:53
Kamleshs7-Aug-06 20:53 
AnswerRe: Help in TCP Connection Pin
stancrm7-Aug-06 20:55
stancrm7-Aug-06 20:55 
GeneralRe: Help in TCP Connection Pin
leppie7-Aug-06 20:58
leppie7-Aug-06 20:58 
AnswerRe: Help in TCP Connection Pin
leppie7-Aug-06 20:56
leppie7-Aug-06 20:56 
QuestionPlease help Pin
minniemooo7-Aug-06 20:47
minniemooo7-Aug-06 20:47 
AnswerRe: Please help Pin
albCode7-Aug-06 21:30
albCode7-Aug-06 21:30 
GeneralRe: Please help Pin
minniemooo7-Aug-06 22:16
minniemooo7-Aug-06 22:16 
GeneralRe: Please help Pin
albCode7-Aug-06 22:26
albCode7-Aug-06 22:26 
Questionrunning application with out framework Pin
Satish327-Aug-06 20:43
Satish327-Aug-06 20:43 
AnswerRe: running application with out framework Pin
leppie7-Aug-06 20:49
leppie7-Aug-06 20:49 
AnswerRe: running application with out framework Pin
stancrm7-Aug-06 20:53
stancrm7-Aug-06 20:53 
AnswerRe: running application with out framework Pin
albCode7-Aug-06 22:29
albCode7-Aug-06 22:29 
QuestionHelp on TCP connection Pin
Girish6017-Aug-06 20:34
Girish6017-Aug-06 20:34 

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.