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 is TButton) then
begin
dlgButton := TButton(aMsgDlg.Components);
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;
MessageDlg nin Butonlarının caption larını değiştirmek
-
- Kıdemli Üye
- Mesajlar: 574
- Kayıt: 01 Şub 2004 12:29
- Konum: Erdemli - MERSİN