Nie latwiej zrobic na MessageDlg?
A jesli juz robisz na wlasnych formach to zrob tak:
Form2:
procedure TForm2.Button1Click(Sender: TObject);
begin
Form2.ModalResult:=mrOK; //To automatycznie zamknie forme
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
Form2.ModalResult:=mrNo;
end;
A w Form1:
procedure TForm1.Button1Click(Sender: TObject);
var R:TModalResult;
begin
R:=Form2.ShowModal;
If R=mrNo then Windows.Beep(400,100);
If R=mrOK then Windows.Beep(4000,100);
end;
A tu masz rozpisane TModalResult:
Constant Value Meaning
mrNone 0 None. Used as a default value before the user exits.
mrOk idOK The user exited with OK button.
mrCancel idCancel The user exited with the CANCEL button.
mrAbort idAbort The user exited with the ABORT button.
mrRetry idRetry The user exited with the RETRY button.
mrIgnore idIgnore The user exited with the IGNORE button.
mrYes idYes The user exited with the YES button.
mrNo idNo The user exited with the NO button.
mrAll mrNo + 1 The user exited with the ALL button.
mrNoToAll mrAll + 1 The user exited with the NO TO ALL button.
mrYesToAll mrNoToAll + 1 The user exited with the YES TO ALL button.
Z reszta.... zobacz sobie w helpie....
[browar]