المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Going back to original IF statement if another one returns false



C# Programming
06-27-2009, 12:10 AM
Hi all I have a problem here and i'd appreciate any advice at all... I have like 20-something IF statements end else and else if (sample below)

if( something.Text != otherthing.Text )
{
if( MessageBox.Show("Really?") == DialogResult.OK )
{
// do something
}
else { // now i want to go to the top and start from the first iff statement again. }
}
else Application.DoEvents();

...Except there's lots more if/else statements nested within one another. And it's very very time-consuming, confusing and after a while it just becomes too much to wrap my brain around. So I guess my question is... I vaigly remember somebody telling me to use Switch/Case things but I've tried reading about them on MSDN and I just can't seem to get my head around it can somebody please explain to me how the switch/case things would work.. In the most dumbest possible way? :P thanks for your time.

thanks lots http://www.barakasoft.com/script/Forums/Images/smiley_biggrin.gif
jase

p.s. sorry if my message doesn't make much sense this time, i haven't slept in 48hours lol http://www.barakasoft.com/script/Forums/Images/smiley_laugh.gif