MessageBox - Overview
MessageBox is a DialogBox Used to inform the Application Status to the End User by displaying Alerts and Warnings. A Simple MessageBox will have DisplayText, Title and OK Button.
In WPF Application MessageBox is created by using MessageBox Class.
1. It is defined in the System.Windows Class
2. It Represents the Modal Dialog Box
3. It has Show() static Method used to display the Messagebox on the Screen.
1. Simple MessageBox
MessageBox.Show("Welcome to Training Session");
2. MessageBox with title
// MessageBox with Title
MessageBox.Show("Welcome to Training Session", "Training");
By Default Only OK Button will be displayed on the Messagebox.
The Messagebox can have following Buttons
1.OKCancel - OK and Cancel buttons are displayed.
// MessageBox with OKCancel button
MessageBox.Show("Do You Want to Attend the Training session", "Training",MessageBoxButton.OKCancel);
2. YesNo - Yes and No buttons are displayed.
// MessageBox with YesNo button
MessageBox.Show("Do You Want to Attend the Training Session", "Training",MessageBoxButton.YesNo);
3. YesNoCancel - Yes,No, and Cancel buttons are displayed
// MessageBox with YesNoCancel button
MessageBox.Show("Do You Want to Attend the Training Session", "Training",MessageBoxButton.YesNoCancel);
Icons can be displayed on the Messagebox to determine the Severity and Importance of the Message. Icons like
1. MessageBox with Icons
//Messagebox with Buttons and Icons
MessageBox.Show("Do You Want to Attend the Training Session", "Training", MessageBoxButton.YesNo, MessageBoxImage.Question);
2. MessageBox with Icons
//MessageBox with Title, Icon, Yes and No Buttons
string message = "Do You Want to Attend WPF Training Session?";
string caption = "Training";
MessageBoxButton buttons = MessageBoxButton.YesNo;
MessageBoxImage icon = MessageBoxImage.Question;
MessageBox.Show(message, caption, buttons, icon);
Note:Depending on the Importance and Significance of the Message Appropriate Icons should be used.
and full information about message box in wpf.
Thank you Shalini for your valuable comments.
Share this Article with you friends.
oh I see I haven't had an SBSC specific action pack yet think i just missed the last one..must look into that I'm interested in the SharePoint event.would like to go if the diary allows!