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

TdxMessageDialogForm.AlignButtons Method

Calculates optimal dimensions and positions of customized buttons.

Declaration

procedure AlignButtons; virtual;

Remarks

Custom captions can be too long to fit into buttons with the predefined size:

Before Layout Recalculation

Call the AlignButtons procedure to recalculate the form layout after button customization:

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;
  ADialog.ShowModal;
finally
  ADialog.Free;
end;

After Layout Recalculations

See Also