Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie - how to correctly exit (return) after you messagebox.show

Status
Not open for further replies.

Gzk2010

Programmer
Aug 17, 2010
48
US
newbie - how to correctly exit (return) after you messagebox.show?

I googled a tried simply
return,


else
MessageBox.Show("You must choose at least one market!");
return;

This does not stop the code from continuing on. I want it to stop after they click OK and put focus back to the button they clicked

Thanks in advance!
 
you must use the modal variant:

MessageBox.Show(this, "You must choose at least one market!", "warning");

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
So it should read:

MessageBox.Show(this, "You must choose at least one market!", "warning");
return;

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top