Use of MessageBox
Use of Message Box:
Message box are commonly used in C# applications. Message boxes are used to display some message to user when an event occurs.
MessageBox is a class whose functionality is provided in the namespace System.Windows.Forms. MessageBox can be displayed by simply calling a method Show().e.g.
MessageBox.Show()
There are 21 built-in overloads for message box Show () method but commonly used are
· Message to display
· Title of message box
· MessageBoxButtons (Buttons on Message box)
· MessageBoxIcon (Icon for Message box)
· MessageBoxDefaultButton (The default selected button)
Now look at a Message box which uses these overloads.
MessageBox.Show("This is a MessageBox","MessageBox",MessageBoxButtons.YesNo,MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
Comments
Post a Comment