Skip to main content
A newer version of this page is available. .

Create(TComponent,TMsgDlgType,TMsgDlgButtons,THandle) Constructor

Creates a message dialog box form with support for DevExpress look & feel settings.

Declaration

constructor Create(AOwner: TComponent; AType: TMsgDlgType; AButtons: TMsgDlgButtons; AOwnerWndHandle: THandle = 0); reintroduce; virtual;

Parameters

Name Type Description
AOwner TComponent

The owner form of the message dialog box. Pass a TCustomForm descendant instance as this parameter to center the message box on top of the owner form. You can pass nil (in Delphi) or nullptr/NULL (in C++Builder) to center the message box on the screen instead.

AType TMsgDlgType

The type of the message dialog box. This type determines the predefined caption, system icon, and sound of the message box. The DialogType property returns this parameter value for any message box form.

AButtons TMsgDlgButtons

A set of buttons on the message dialog box form.

AOwnerWndHandle THandle

A handle to the owner window of the message box. The dxMessageBox global functions use this parameter to emulate the system MessageBox function behavior. Use the AOwner parameter if you need to specify the owner window for the created message box.

Remarks

Call this constructor to create a message dialog box form. Then, use the form’s Message property to specify the text you need to display. Call the ShowModal procedure to display the message box:

var
  ADialog: TdxMessageDialogForm;
begin
  ADialog := TdxMessageDialogForm.Create(nil, mtWarning, mbYesNoCancel);
try
  ADialog.Message := 'One or more margins are set outside the printable area of the page.' + #13#10 +
    'Choose the [B]Yes[/B] button to increase the appropriate margins.';
  ADialog.ShowModal;  // Invokes the message box as a modal dialog
finally
  ADialog.Free;
end;

Message Dialog Box Example

Alternatively, you can call one of the following global methods:

See Also