Select Categories Below
Status: Closed Points: 75 Time: 06:13 - Mar 01, 2007
dustPuppy
I'm programming my first windows .net application in C# and I need to show an error alert, similar to the alert in javascript in web applications. I tried with ShowDialog, but it requires a windows form to show as far as i understand. Isn't there something more simple, like the web counterpart?
Categories:
Add Categories
When adding more than one category, separate them with commas.
Advertisement
rcastagna
Date:: Mar 01, 2007
Time:: 07:59
Hey, dust...venturing out past the web world, I see! (It's a dark, scary world out there...turn back while there's still hope!) 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
Time:: 08:02
great, exactly what I was looking for... your the man, ric :)
Date:: Mar 02, 2007
Time:: 14:04
Hey, dust...just wanted to see if that worked for you and to gently remind you to award the points, if appropriate. :) Ric
Date:: Mar 23, 2007
Time:: 15:11
sorry about that Ric, i forgot to close the question. here are the points...
Prajith
Date:: Jul 24, 2007
Time:: 13:05
Hi, 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);
Question Answered
This question has been closed, and points have been rewarded to the following experts:
You're welcome however to comment or give additional information or if you wish, you have the ability to write an Answer Summary for the Summary Area.
Answer this Question
New User
Email:
Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address
Registered User
Username:
Password:
Forgot Your Password?
Enter your email address below and we will resend your login information to you.
Login Information Sent
Questions
hover gallery.
How long does Google and MSN store emails that can...
Does the United States Government have a CIO posit...
How do you turn off the signature option in the ad...
audio quality- when playing music/video's, the sou...
Thanks for your reply. Where are you located? Whic...
You have 100 characters to use
Rank
Expert
Points
1.
885
2.
515
3.
488
4.
200
5.
75
6.
50
7.
8.
30
9.
25
10.
20
Register today to share your knowledge with the community and be recognized and rewarded for your contributions.
Register Here
"Psst, Quomon is a great site. Pass it on." Tell a Friend | Link To Us | Save to Delicious | Digg it
Language Options
English:
Español:
Sponsors
Questions and Answers Software Real Estate Postcards Marketing Fulfillment