| oguzozturk74 | 14.03.2004 - 00:01:47 |
| function MyMessageDialog(const Msg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; Captions: array of string): Integer; var aMsgDlg: TForm; i: Integer; dlgButton: TButton; CaptionIndex: Integer; begin aMsgDlg := CreateMessageDialog(Msg, DlgType, Buttons); captionIndex := 0; for i := 0 to aMsgDlg.ComponentCount - 1 do begin if (aMsgDlg.Components[i] is TButton) then begin dlgButton := TButton(aMsgDlg.Components[i]); if CaptionIndex > High(Captions) then Break; dlgButton.Caption := Captions[CaptionIndex]; Inc(CaptionIndex); end; end; Result := aMsgDlg.ShowModal; end; procedure TForm1.Button1Click(Sender: TObject); begin if MyMessageDialog('How much...?', mtConfirmation, mbOKCancel, ['Tamam', 'İptal']) = mrOk then ShowMessage('"'Tamam'" tıklandı') else ShowMessage('"'İptal'" tıklandı'); end; | |