shidqul

Unit1.pas

Dec 22nd, 2016
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.28 KB | None | 0 0
  1. function DialogKonfirmasi(Pesan1, Pesan2: String): boolean;
  2. begin
  3.  DialogKonfirmasi := True;
  4.  {MessageDlg dengan button bahasa indonesia.}
  5.  with CreateMessageDialog(Pesan1, mtConfirmation, [mbYes, mbNo]) do
  6.   begin
  7.    try
  8.     Caption := 'Pesan Konfirmasi';
  9.     TButton(FindComponent('Yes')).Caption := 'Ya';
  10.     TButton(FindComponent('No')).Caption := 'Tidak';
  11.     case ShowModal of
  12.      mrYes : begin
  13.               with CreateMessageDialog(Pesan2, mtConfirmation, [mbYes, mbNo]) do
  14.                begin
  15.                 try
  16.                  Caption := 'Pesan Konfirmasi';
  17.                  TButton(FindComponent('Yes')).Caption := 'Ya';
  18.                  TButton(FindComponent('No')).Caption := 'Tidak';
  19.                  case ShowModal of
  20.                   mrNo  : begin
  21.                            DialogKonfirmasi := False;
  22.                            Exit;
  23.                           end;
  24.                  end;
  25.                 finally
  26.                  Free;
  27.                 end;
  28.                end;
  29.              end;
  30.      mrNo  : begin
  31.               DialogKonfirmasi := False;
  32.               Exit;
  33.              end;
  34.     end;
  35.    finally
  36.     Free;
  37.    end;
  38.   end;
  39. end;
  40.  
  41. procedure TForm1.Button1Click(Sender: TObject);
  42. begin
  43.  DialogKonfirmasi(Edit1.Text, Edit2.Text);
  44. end;
Advertisement
Add Comment
Please, Sign In to add comment