unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm2 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure FormHide(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

// BeginExample: TFormOnHide2
// Event: Forms.TCustomForm.OnHide

// BeginCode
{
This is the implementation section of Unit2:
}
implementation

{$R *.dfm}

uses TFormOnHide;

procedure TForm2.Button1Click(Sender: TObject);
begin
  Form1.Show;
  Hide;
end;

procedure TForm2.FormHide(Sender: TObject);
begin
  Form1.Label1.Caption := 'Form2 is hiding';
end;
// EndCode
// EndExample: TFormOnHide2
end.
