0

Hey there.

I was wondering if it was possible to stop execution at a certain point without closing the Program?

For example

Private some button is clicked

code
code
code
code
But here i want execution to stop as the user did something wrong
code
code
code
code

I have a Form1, So when the execution stops, the Form1 should still be showing

Thank you
Ruan

2
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by Mr.BunyRabit
1

Use return statement.

public void test()
{
   //code
   if(test_your_condition)
      {
         return;
       }
   //code
}
0

Use return statement.

public void test()
{
   //code
   if(test_your_condition)
      {
         return;
       }
   //code
}

That works perfectly, Thank you =)
Hava great day.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.