Topic: Configure Form closure button

I have 2 forms, Form_01_About and Form_02_Menu. I need to configure a button in Form_01_About such that on clicking, Form_01_About closes or hides and Form_02_Menu opens. I used "Show Form" as an action for the button but the script (Form_01_About.Hide) for OnClose event for the button shows error. Please help.

Re: Configure Form closure button

Please attach your project.

Dmitry.

Re: Configure Form closure button

Please examine the attached Project.
Regards,
Eyeman

Post's attachments

Attachment icon Insurance.zip 327.67 kb, 248 downloads since 2020-04-10 

Re: Configure Form closure button

Your event procedure with mistake, missing parameter Cancel, should be:

procedure Form_01_About_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
    Form_01_About.Hide;
end;

intead

procedure Form_01_About_Button1_OnClick (Sender: TObject);
begin
    Form_01_About.Hide;
end;


Also you must close main form, when you close your application, otherwise the application process will remain in memory

procedure Form_02_Menu_OnClose (Sender: TObject; Action: string);
begin
    Form_01_About.Close;
end;
Dmitry.

Re: Configure Form closure button

Thanks, Dmitry.
The issue is solved and app working as desired. Can you please suggest one resource for me, to get a better understanding of this language?
Regards,
Eyeman

Re: Configure Form closure button

http://myvisualdatabase.com/forum/viewtopic.php?id=2277

Dmitry.