Skip to main content

dxCreateMessageDialog(string,TMsgDlgType,TMsgDlgButtons) Method

Creates a message dialog box form with the specified settings.

Declaration

function dxCreateMessageDialog(const AMessage: string; ADialogType: TMsgDlgType; AButtons: TMsgDlgButtons): TdxMessageDialogForm;

Parameters

Name Type Description
AMessage string

Message box dialog content. The AMessage parameter value initializes the created form’s Message property.

The AMessage parameter supports a set of BBCode-inspired tags that allow you to format message box content. Refer to the Remarks section for the full list of supported formatting tags.

ADialogType TMsgDlgType

A type message dialog box type that determines the predefined caption, system icon, and sound of the message dialog box.

AButtons TMsgDlgButtons

A set of buttons on the message dialog box form.

Returns

Type Description
TdxMessageDialogForm

The created message dialog box form.

Remarks

You can call the dxCreateMessageDialog function instead of the TdxMessageDialogForm constructor. The created message dialog box has the mdsMessageDlg style.

VCL Editors Library: Message Dialog Box Example

Supported BBCode-Inspired Markup Tags

Text Formatting Attribute Message Text with Tags Example
Bold '[B]DevExpress[/B]' VCL Editors Library: A Bold Font Attribute Example
Italic '[I]DevExpress[/I]' VCL Editors Library: An Italic Font Attribute Example
Underscore '[U]DevExpress[/U]' VCL Editors Library: An Underscore Font Attribute Example
Strikeout '[S]DevExpress[/S]' VCL Editors Library: A Strikeout Font Attribute Example
Subscript 'Dev[Sub]Express[/Sub]' VCL Editors Library: A Subscript Font Attribute Example
Superscript 'Dev[Sup]Express[/Sup]' VCL Editors Library: A Superscript Font Attribute Example
Custom Font 'Dev[U][Font=Consolas][Size=12]Express[/U][/Font][/Size]' VCL Editors Library: A Custom Font Settings Example
Color '[Color=#E67E22]Dev[/Color][Color=Gray]Express[/Color]' VCL Editors Library: A Color Font Attribute Example
Background Color '[BackColor=Orange]DevExpress[/BackColor]' VCL Editors Library: A Background Color Font Attribute Example
Hyperlink '[URL=http://www.devexpress.com/]DevExpress[/URL]' VCL Editors Library: A Hyperlink Example
No Parse '[NOPARSE][B]DevExpress[/B][/NOPARSE]' VCL Editors Library: A "No Parse" Example

Code Example

The following code example calls the dxCreateMessageDialog function to create a message box with three buttons and customizes their captions:

uses dxMessageDialog;
// ...
var
  ADialog: TdxMessageDialogForm;
  AMessage: string;
begin
  AMessage := 'One or more margins are set outside the printable area of the page.' + #13#10 +
    'Choose the [B]Fix[/B] button to increase the appropriate margins.';
  ADialog := dxCreateMessageDialog(AMessage, mtWarning, mbYesNoCancel);
  try
    ADialog.FindButton(mbYes).Caption := 'Fix';
    ADialog.FindButton(mbNo).Caption := 'Restore Original';
    ADialog.FindButton(mbCancel).Caption := 'Close';

    ADialog.AlignButtons;  // Recalculates the button layout
    ADialog.ShowModal;     // Invokes the form as a modal dialog
  finally
    ADialog.Free;  // Releases the message box form once a user closes it
end;

Limitation

The dxUseStandardMessageDialogs global variable has no effect on dxCreateMessageDialog function calls.

See Also