windowsforms-devexpress-dot-xtraeditors-dot-xtramessagebox-dot-show-x28-system-dot-string-x29.md
Displays the XtraMessageBox with the specified text.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public static DialogResult Show(
string text
)
Public Shared Function Show(
text As String
) As DialogResult
| Name | Type | Description |
|---|---|---|
| text | String |
A string value that specifies the text to display in the message box.
|
| Type | Description |
|---|---|
| DialogResult |
One of the DialogResult values.
|
| Parameter | Default Value | Property Name |
|---|---|---|
Caption | String.Empty | Caption |
Buttons | MessageBoxButtons.OK | Buttons |
DefaultButtonIndex | 0 | DefaultButtonIndex |
Owner | null | Owner |
Icon | MessageBoxIcon.None | ImageOptions |
The following code snippet displays the XtraMessageBox with formatted text and a warning icon. If the user clicks Yes , the application closes the current form.
using DevExpress.XtraEditors;
using DevExpress.Utils;
if(XtraMessageBox.Show(
"Do you want to close the <b>form</b>?", "Warning",
MessageBoxButtons.YesNo, MessageBoxIcon.Warning,
DefaultBoolean.True) == DialogResult.Yes)
this.Close();
Imports DevExpress.XtraEditors
Imports DevExpress.Utils
If XtraMessageBox.Show("Do you want to close the <b>form</b>?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, DefaultBoolean.True) = DialogResult.Yes Then
Me.Close()
End If
The following code snippets (auto-collected from DevExpress Examples) contain references to the Show(String) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-mvvm-best-practices/CS/DelegateCommands/SimpleCommandUserControl.cs#L24
{
XtraMessageBox.Show("Hello! I'm running!");
});
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Export.cs#L50
DevExpress.XtraEditors.XtraMessageBox.SmartTextWrap = true;
DevExpress.XtraEditors.XtraMessageBox.Show(plainText);
#endregion #ExportRangeToPlainText
winforms-scheduler-sync-with-ews/CS/EWSSyncExample/ExchangeExampleForm.cs#L43
synchronizer.ExchangeToScheduler(schedulerControl1.DataStorage.Appointments, apt, true);
XtraMessageBox.Show("Imported");
}
connect-winforms-grid-to-backend-using-middletier-server/CS/WinForms.Client/MainForm.cs#L95
catch(System.Security.SecurityException) {
XtraMessageBox.Show("Modifying this data row is restricted for security reasons.");
}
connect-winforms-grid-to-webapi-service/CS/WinForms.Client/AuthForm.cs#L15
if(authToken == null) {
XtraMessageBox.Show("Problem with authentificate");
DialogResult = DialogResult.Cancel;
winforms-mvvm-best-practices/VB/DelegateCommands/SimpleCommandUserControl.vb#L21
Dim command As New DelegateCommand(
Sub() XtraMessageBox.Show("Hello! I'm running!"))
' UI binding for button
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Export.vb#L44
DevExpress.XtraEditors.XtraMessageBox.SmartTextWrap = True
DevExpress.XtraEditors.XtraMessageBox.Show(plainText)
#End Region ' #ExportRangeToPlainText
winforms-scheduler-sync-with-ews/VB/EWSSyncExample/ExchangeExampleForm.vb#L46
Next apt
XtraMessageBox.Show("Imported")
End Sub
connect-winforms-grid-to-backend-using-middletier-server/VB/WinForms.Client/MainForm.vb#L66
Catch __unusedSecurityException1__ As System.Security.SecurityException
XtraMessageBox.Show("Modifying this data row is restricted for security reasons.")
End Try
Private Sub actionInPopup_Execute(ByVal sender As Object, ByVal e As SimpleActionExecuteEventArgs)
XtraMessageBox.Show(String.Format("Hello {0}!", e.CurrentObject))
End Sub
See Also