ShowModal (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This code brings up the modal dialog from Unit2 when a button is clicked. It causes a Beep if the OK button is clicked. Implement the modal form in Unit2 and then put Unit2 in the uses clause for this module.

Code

procedure TForm1.Button1Click(Sender: TObject);
begin
  if MyDialogBox1.ShowModal = mrOK then
    Beep;
end;

Uses