vcl-dxmessagedialog-dot-tdxmessagedialogform-dot-create-x28-system-dot-classes-dot-tcomponent-vcl-dot-dialogs-dot-tmsgdlgtype-vcl-dot-dialogs-dot-tmsgdlgbuttons-system-dot-thandle-x29.md
Creates a message dialog box form with support for DevExpress look & feel settings.
constructor Create(AOwner: TComponent; AType: TMsgDlgType; AButtons: TMsgDlgButtons; AOwnerWndHandle: THandle = 0); reintroduce; virtual;
| 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 (in C++Builder) to center the message box on the screen instead.
| | AType | TMsgDlgType |
A message dialog box type that determines the predefined caption, system icon, and sound of the message dialog box.
This parameter value initializes the created form’s DialogType property.
| | AButtons | TMsgDlgButtons |
A set of buttons on the message dialog box form.
| | AOwnerWndHandle | THandle |
This parameter value initializes the created message box’s Owner property.
The parameter allows dxMessageBox global functions to emulate system MessageBox function behavior.
|
Call this constructor to create a message dialog box form. Use the created form’s Message property to specify the text string you need to display. Call the ShowModal procedure to display the message box.
The following code example creates a Warning message box with a formatted message and three standard buttons:
uses dxMessageDialog;
// ...
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 +
#13#10 + 'Click the [B]Yes[/B] button to increase these margins.';
ADialog.ShowModal; // Displays the message box as a modal dialog
finally
ADialog.Free; // Releases the message box form when a user closes it
end;
end;
#include "dxMessageDialog.hpp"
// …
TdxMessageDialogForm *ADialog;
ADialog = new TdxMessageDialogForm(nullptr, wtWarning, mbYesNoCancel);
try
{
ADialog->Message = "One or more margins are set outside the printable area of the page.\n" +
"\n" + "Click the [B]Yes[/B] button to increase these margins.";
ADialog->ShowModal(); // Displays the message box as a modal dialog
}
__finally
{
delete ADialog; // Releases the message box form when a user closes it
}
CreateCreates a message dialog box form with support for DevExpress look & feel settings.dxCreateMessageDialog
dxCreateMessageDialog(…) | dxCreateMessageDialog(…,ADefaultButton,…)
These functions create a message dialog box with a specified dialog type, message, and a set of buttons.
The second variant allows you to explicitly specify the default button (ADefaultButton).
dxMessageBox
dxMessageBox(…) | dxMessageBox(AOwnerWndHandle,…)
These functions open a message dialog box that displays a specified message, title, and a set of buttons (configured using a combination of flags).
The second variant allows you to associate the message box with an owner window (AOwnerWndHandle).
dxMessageDlg
dxMessageDlg(…) | dxMessageDlg(…,ADefaultButton,…) | dxMessageDlg(…,ATitle,…,ADefaultButton,…)
These functions open a message dialog box with a specified dialog type, message, and a set of buttons.
Second and third variants allow you to explicitly specify the default button (ADefaultButton).
In addition, the third variant allows you to specify the message box title (ATitle).
dxMessageDlgPos
dxMessageDlgPos(…) | dxMessageDlgPos(…ADefaultButton,…) | dxMessageDlgPos(…,ATitle,…,ADefaultButton,…)
These functions open a message dialog box at a specified position on the screen. The message box has a specified dialog type, message, a set of buttons, and an associated help context.
Second and third variants allow you to explicitly specify the default button (ADefaultButton).
In addition, the third variant allows you to specify the message box title (ATitle).
dxMessageDlgPosHelp
dxMessageDlgPosHelp() | dxMessageDlgPosHelp(…ADefaultButton,…) | dxMessageDlgPosHelp(…,ATitle,…,ADefaultButton,…)
These functions open a message dialog box with a help topic supplied in a help file. The message box opens at a specified position on the screen and has a specified dialog type, message, a set of buttons, and an associated help context.
Second and third variants allow you to explicitly specify the default button (ADefaultButton).
In addition, the third variant allows you to specify the message box title (ATitle).
dxShowMessageOpens a generic message dialog box with an OK button.dxShowMessageFmtOpens a generic message dialog box with a formatted message and an OK button.dxShowMessagePosOpens a generic message dialog box at a specified position on the screen. See Also