I know this issue have been up since before (ex. Best way to show customized message dialogs), but I still don\'t find what I want.
I started like this:
I write this code: (I am from Croatia, so the texts are in Croatian)
function MojDijalog(const Msg, Capt: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons;
DefaultButton: TMsgDlgBtn): TModalResult;
var
dlg : TForm;
begin
dlg := CreateMessageDialog(Msg, DlgType, Buttons, DefaultButton) ;
with dlg do begin
Caption := Capt;
FormStyle := fsStayOnTop;
( FindComponent( 'OK' ) as TButton ).Caption := 'U redu' ;
( FindComponent( 'Cancel' ) as TButton ).Caption := 'Odustani' ;
( FindComponent( 'Yes' ) as TButton ).Caption := 'Da' ;
( FindComponent( 'No' ) as TButton ).Caption := 'Ne' ;
( FindComponent( 'Help' ) as TButton ).Caption := 'Pomoć' ;
( FindComponent( 'Close' ) as TButton ).Caption := 'Zatvori' ;
( FindComponent( 'Ignore' ) as TButton ).Caption := 'Zanemari' ;
( FindComponent( 'Retry' ) as TButton ).Caption := 'Pokušaj ponovo' ;
( FindComponent( 'Abort' ) as TButton ).Caption := 'Prekini' ;
( FindComponent( 'All' ) as TButton ).Caption := 'Sve' ;
end;
Result := dlg.ShowModal;
end;
Example of use :
if MojDijalog('Obrisati zapis ?','Upit za brisanje',mtConfirmation,mbYesNo,mbNo) = mrNo then
begin
Abort;
end;