Click here to Skip to main content
15,891,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
Now, im sure you are going to read this question and think this guy is a idiot, you are most likely right.

However in my code as we all know when you click on a button the code for the button click fires up. I have put multiple different if loops in this section.

What i have forgot how to do is (if one if loop is equal) then stop the rest of the code within the button click and stop any other of the different loops from executing. I know normally how to do this but my mind has blanked :/

Please jog my memory. :)
Posted

1 solution

C#
if (something == somethingelse)
    return;


That should do it...

But if it doesn't, you will have to share your code.
 
Share this answer
 
Comments
Maciej Los 12-Dec-13 16:56pm    
if(return terminates execution of code)
execution of code is terminated;

+5!
Extra link: return (C# reference)[^]
Member 9665875 12-Dec-13 16:56pm    
that does it very nice cheers dudos

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900