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

TdxMessageDialogForm.SetDefaultButton(TMsgDlgBtn) Method

Sets the specified button as the default button for the message dialog box.

Declaration

procedure SetDefaultButton(AButton: TMsgDlgBtn); virtual;

Parameters

Name Type Description
AButton TMsgDlgBtn

A message dialog button type.

Remarks

The default message box button has focus when the message box is invoked. The following code example sets the No button as default:

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]Yes[/B] button to increase the appropriate margins.';
  ADialog := dxCreateMessageDialog(AMessage, mtWarning, mbYesNoCancel);
try
  ADialog.SetDefaultButton(mbNo);
  ADialog.ShowModal;
finally
  ADialog.Free;
end;

Default Button Example

See Also