Answers

Mar 01, 2007 - 03:59 AM
Seriously, though...if you're looking for something like the javascript alert() or confirm() take a look at MessageBox.Show in your windows form.
Here's some sample code that will give you a messagebox with your typical OK/Cancel buttons like a javascript confirm():
DialogResult dlgRes = null
dlgRes = MessageBox.Show(
"Are you sure you want to close without saving the document",
"Confirm Document Close",
MessageBoxButtons.YesNoCancel,
MessageBoxIcon.Question);
if(dlgRes == DialogResult.Yes) { Application.Exit(); }
There are other ENUM combinations available for the buttons in MessageBoxButtons so you should be able to tailor and trap the user's response as necessary.
I hope this helps...
Ric

Mar 01, 2007 - 04:02 AM
your the man, ric :)

Mar 02, 2007 - 10:04 AM
Ric

Mar 23, 2007 - 12:11 PM
here are the points...

Jul 24, 2007 - 10:05 AM
Using MessageBox itself you can show alert. You can even have custom images on your MessageBox
MessageBox.Show("Your Alert Message", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

Feb 07, 2010 - 10:30 PM
i am student,i am doing work a project,sir my problem how automatic timing alert in winform,plz help me
Thanks

Sep 06, 2014 - 06:14 AM

Oct 26, 2014 - 09:58 PM
your the man, ric :)
Add New Comment