I'd like to use the application.OnMinimise event in my application. I've tried the following approach to override the onMinimize the event and point it to my event handler in the mainform.
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.OnMinimize := Tform1.onMinimize;
Application.Run;
end.
and in the main form I used the following construct:
procedure Tform1.onMinimize (Sender: TObject);
begin
Tform1.visible := false; { sample code }
end;
However when the code is complied I get a error message stating that the types procedure and Tnotifyevent are incompatable. Obviously I'm missing something fundmental.
Any suggestions or alternate approaches would be appreciated.
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.OnMinimize := Tform1.onMinimize;
Application.Run;
end.
and in the main form I used the following construct:
procedure Tform1.onMinimize (Sender: TObject);
begin
Tform1.visible := false; { sample code }
end;
However when the code is complied I get a error message stating that the types procedure and Tnotifyevent are incompatable. Obviously I'm missing something fundmental.
Any suggestions or alternate approaches would be appreciated.