Saturday, September 16, 2006

begin
with CreateMessageDialog(Msg, DlgType, Buttons) do
try
Caption := Title;
HelpContext := HelpCtx;
Font.Color := clRed;
Font.Size := 7;
Font.Style := [fsBold];
Font.Color := clRed;
Font.Name := 'Verdana';
for Cnt := 0 to ComponentCount - 1 do
begin
if Components[Cnt] is TButton then
begin
Btn:= TButton(Components[Cnt]);
Btn.Default := Btn.ModalResult = DefButton;
if Btn.Caption = '&Yes' then Btn.Caption := '&Ano';
if Btn.Caption = '&No' then Btn.Caption := '&Ne';
if Btn.Caption = 'Cancel' then Btn.Caption := '&Storno';
if Btn.Default then ActiveControl := Btn;
end;
end;
Result := ShowModal;
finally
free;
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
if DefMessageDlg('Otázka ?', 'Chcete opravdu zformátovat disk ?', mtConfirmation, mbYesNoCancel, mrNo, 0) = mrYes then ShowMessage('Formátuji...čekejte');
end;