Skip to content

Exit An Event

CJ

Asked Nov 22, 2005, 5:57 AM EST1 answer
Share
LinkedInX
This should be simple.  How do I exit an event and return to form if a condition is met?

For example:

private void button3_Click(object sender, System.EventArgs e)

{
if (selectedIndex.ToString().Equals("-1"))

MessageBox.Show("Please select database to pull from.");

PUT EXIT CODE HERE!!!!!!!
}

Thanks,
cj

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Use the return statement return; return will throw the control out of the procedure Hope this helps :) Anuj
    0