Skip to main content

AlertControl.Show(Form, String, String) Method

Displays an alert window with the specified text and caption.

Namespace: DevExpress.XtraBars.Alerter

Assembly: DevExpress.XtraBars.v26.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public void Show(
    Form owner,
    string caption,
    string text
)

Parameters

Name Type Description
owner Form

An owner of the window. In a multi-monitor system, if the owner is set to null, the window will be displayed on the main monitor. Otherwise, the window will be displayed on the same monitor as the owner.

caption String

A string that specifies the window’s caption.

text String

A string that specifies the window’s text, displayed when the text region is not hovered over.

Remarks

If the AlertControl.AllowHtmlText property is enabled, you can use HTML tags to format an alert window’s caption and text. See HTML Text Formatting to learn more.

You can handle the AlertControl.BeforeFormShow event to customize the newly created alert window before its appearance on-screen.

The following example demonstrates how to show and close alert windows:

using DevExpress.XtraBars.Alerter;

// Displays an alert window.
alertControl1.Show(this, "Alert", "The alert description.");

// Closes all active alert windows.
foreach(AlertForm alert in alertControl1.AlertFormList)
    alert.Close();

// Closes the specified alert window.
AlertForm alertWindow = alertControl1.AlertFormList[0];
if(alertWindow != null)
    alertWindow.Close();
See Also