Class ExMessageBox
- Namespace
- ExControls
- Assembly
- ExControls.dll
Displays a message window, also known as a dialog box, which presents a message to the user.
It is a modal window, blocking other actions in the application until the user closes it.
A MessageBox can contain text, buttons, and symbols that inform and instruct the user.
public sealed class ExMessageBox
- Inheritance
-
ExMessageBox
- Inherited Members
Constructors
ExMessageBox()
Initializes a new instance of the ExMessageBox class.
public ExMessageBox()
ExMessageBox(string)
Initializes a new instance of the ExMessageBox class with text.
public ExMessageBox(string text)
Parameters
textstringtext in MessageBox's message
ExMessageBox(string, string)
Initializes a new instance of the ExMessageBox class with text and caption.
public ExMessageBox(string text, string caption)
Parameters
ExMessageBox(IWin32Window?)
Initializes a new instance of the ExMessageBox class with specified owner.
public ExMessageBox(IWin32Window? owner)
Parameters
ownerIWin32Windowowner of this MessageBox
ExMessageBox(IWin32Window?, string)
Initializes a new instance of the ExMessageBox class with specified owner and text.
public ExMessageBox(IWin32Window? owner, string text)
Parameters
ownerIWin32Windowowner of this MessageBox
textstringtext in MessageBox's message
ExMessageBox(IWin32Window?, string, string)
Initializes a new instance of the ExMessageBox class with specified owner, text and caption.
public ExMessageBox(IWin32Window? owner, string text, string caption)
Parameters
ownerIWin32Windowowner of this MessageBox
textstringtext in MessageBox's message
captionstringcaption of the MessageBox
Properties
ButtonAbortText
Gets or sets text of Abort button in MessageBox.
public static string ButtonAbortText { get; set; }
Property Value
ButtonCancelText
Gets or sets text of Cancel button in MessageBox.
public static string ButtonCancelText { get; set; }
Property Value
ButtonHelpText
Gets or sets text of Help button in MessageBox.
public static string ButtonHelpText { get; set; }
Property Value
ButtonIgnoreText
Gets or sets text of Ignore button in MessageBox.
public static string ButtonIgnoreText { get; set; }
Property Value
ButtonNoText
Gets or sets text of No button in MessageBox.
public static string ButtonNoText { get; set; }
Property Value
ButtonOKText
Gets or sets text of OK button in MessageBox.
public static string ButtonOKText { get; set; }
Property Value
ButtonRetryText
Gets or sets text of Retry button in MessageBox.
public static string ButtonRetryText { get; set; }
Property Value
ButtonYesText
Gets or sets text of Yes button in MessageBox.
public static string ButtonYesText { get; set; }
Property Value
Buttons
Gets or sets buttons visible in MessageBox.
public MessageBoxButtons Buttons { get; set; }
Property Value
Caption
Gets or sets the caption of the MessageBox.
public string Caption { get; set; }
Property Value
Countdown
Gets or sets an interval in seconds. After exceeding the limit the MessageBox closes itself
public int Countdown { get; set; }
Property Value
DefaultButton
Gets or sets default button in MessageBox.
public MessageBoxDefaultButton DefaultButton { get; set; }
Property Value
Form
Gets form of this MessageBox.
public ExMessageBoxForm Form { get; }
Property Value
Icon
Gets or sets the icon showing in the MessageBox.
public MessageBoxIcon Icon { get; set; }
Property Value
IconProvider
Gets or sets a function that supplies the image of the message box icon (e.g. icons of the application) for the icon type and the control that shows it; when it is null or returns null, the system stock icon is shown. The message box does not dispose the image.
public static Func<MessageBoxIcon, Control, Image?>? IconProvider { get; set; }
Property Value
Options
Gets or sets options for MessageBox.
public MessageBoxOptions Options { get; set; }
Property Value
Owner
Gets owner of this MessageBox.
public IWin32Window? Owner { get; }
Property Value
ShowHelp
Gets or sets visibility of Help button in MessageBox.
public bool ShowHelp { get; set; }
Property Value
Style
Gets or sets style of components in MessageBox.
public static ExMessageBoxStyle Style { get; set; }
Property Value
Text
Gets or sets the text associated with this control.
public string Text { get; set; }
Property Value
Methods
Show()
Displays a message window, also known as a dialog box, which presents a message to the user. It is a modal window, blocking other actions in the application until the user closes it.
public DialogResult Show()
Returns
- DialogResult
One of the DialogResult values.
Exceptions
- ArgumentException
when Form is null
Show(string, int)
Displays a message box with specified text.
public static DialogResult Show(string text, int countdown = -1)
Parameters
textstringtext in MessageBox's message
countdownintcountdown in seconds before the default button is pressed; -1 = no countdown
Returns
- DialogResult
the button the user pressed
Show(string, string, int)
Displays a message box with specified text and caption.
public static DialogResult Show(string text, string caption, int countdown = -1)
Parameters
Returns
Show(string, string, MessageBoxButtons, int)
Displays a message box with specified text, caption, and style.
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, int countdown = -1)
Parameters
textstringcaptionstringbuttonsMessageBoxButtonscountdownint
Returns
Show(string, string, MessageBoxButtons, MessageBoxIcon, int)
Displays a message box with specified text, caption, and style.
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, int countdown = -1)
Parameters
textstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIconcountdownint
Returns
Show(string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, int)
Displays a message box with specified text, caption, and style.
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, int countdown = -1)
Parameters
textstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtoncountdownint
Returns
Show(string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, bool, int)
Displays a message box with specified text, caption, and style with Help Button.
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, bool displayHelpButton, int countdown = -1)
Parameters
textstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtonoptionsMessageBoxOptionsdisplayHelpButtonboolcountdownint
Returns
Show(string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, int)
Displays a message box with specified text, caption, and style.
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, int countdown = -1)
Parameters
textstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtonoptionsMessageBoxOptionscountdownint
Returns
Show(string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, string, int)
Displays a message box with specified text, caption, style and Help file Path .
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, int countdown = -1)
Parameters
textstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtonoptionsMessageBoxOptionshelpFilePathstringcountdownint
Returns
Show(string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, string, string, int)
Displays a message box with specified text, caption, style, Help file Path and keyword.
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, string keyword, int countdown = -1)
Parameters
textstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtonoptionsMessageBoxOptionshelpFilePathstringkeywordstringcountdownint
Returns
Show(string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, string, HelpNavigator, int)
Displays a message box with specified text, caption, style, Help file Path and HelpNavigator.
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, int countdown = -1)
Parameters
textstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtonoptionsMessageBoxOptionshelpFilePathstringnavigatorHelpNavigatorcountdownint
Returns
Show(string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, string, HelpNavigator, object, int)
Displays a message box with specified text, caption, style, Help file Path ,HelpNavigator and object.
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param, int countdown = -1)
Parameters
textstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtonoptionsMessageBoxOptionshelpFilePathstringnavigatorHelpNavigatorparamobjectcountdownint
Returns
Show(IWin32Window, string, int)
Displays a message box with specified text.
public static DialogResult Show(IWin32Window owner, string text, int countdown = -1)
Parameters
ownerIWin32Windowtextstringcountdownint
Returns
Show(IWin32Window, string, string, int)
Displays a message box with specified text and caption.
public static DialogResult Show(IWin32Window owner, string text, string caption, int countdown = -1)
Parameters
ownerIWin32Windowtextstringcaptionstringcountdownint
Returns
Show(IWin32Window, string, string, MessageBoxButtons, int)
Displays a message box with specified text, caption, and style.
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, int countdown = -1)
Parameters
ownerIWin32WindowtextstringcaptionstringbuttonsMessageBoxButtonscountdownint
Returns
Show(IWin32Window, string, string, MessageBoxButtons, MessageBoxIcon, int)
Displays a message box with specified text, caption, and style.
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, int countdown = -1)
Parameters
ownerIWin32WindowtextstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIconcountdownint
Returns
Show(IWin32Window, string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, int)
Displays a message box with specified text, caption, and style.
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, int countdown = -1)
Parameters
ownerIWin32WindowtextstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtoncountdownint
Returns
Show(IWin32Window, string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, int)
Displays a message box with specified text, caption, and style.
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, int countdown = -1)
Parameters
ownerIWin32WindowtextstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtonoptionsMessageBoxOptionscountdownint
Returns
Show(IWin32Window, string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, string, int)
Displays a message box with specified text, caption, style and Help file Path for a IWin32Window.
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, int countdown = -1)
Parameters
ownerIWin32WindowtextstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtonoptionsMessageBoxOptionshelpFilePathstringcountdownint
Returns
Show(IWin32Window, string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, string, string, int)
Displays a message box with specified text, caption, style, Help file Path and keyword for a IWin32Window.
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, string keyword, int countdown = -1)
Parameters
ownerIWin32WindowtextstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtonoptionsMessageBoxOptionshelpFilePathstringkeywordstringcountdownint
Returns
Show(IWin32Window, string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, string, HelpNavigator, int)
Displays a message box with specified text, caption, style, Help file Path and HelpNavigator for IWin32Window.
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, int countdown = -1)
Parameters
ownerIWin32WindowtextstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtonoptionsMessageBoxOptionshelpFilePathstringnavigatorHelpNavigatorcountdownint
Returns
Show(IWin32Window, string, string, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, string, HelpNavigator, object, int)
Displays a message box with specified text, caption, style, Help file Path ,HelpNavigator and object for a IWin32Window.
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param, int countdown = -1)
Parameters
ownerIWin32WindowtextstringcaptionstringbuttonsMessageBoxButtonsiconMessageBoxIcondefaultButtonMessageBoxDefaultButtonoptionsMessageBoxOptionshelpFilePathstringnavigatorHelpNavigatorparamobjectcountdownint
Returns
Events
HelpRequested
Occurs when the user requests help for a control.
public event HelpEventHandler? HelpRequested