Topic: How to call from form1 procedure form2_OnClose

Hi,

I have a button1 on form1. When I click on button1 on form1, I want to call procedure procedure form2_OnClose

I can probaly copy code from procedure procedure form2_OnClose but i want to know if I can call any procedure ?

Regards,
С уважением


Спасибо

Pierre P.

Re: How to call from form1 procedure form2_OnClose

Hello.


Yes, you can

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
    Form2_OnClose(nil, '');
end;
Dmitry.

Re: How to call from form1 procedure form2_OnClose

Thanks

Regards,
С уважением


Спасибо

Pierre P.

Re: How to call from form1 procedure form2_OnClose

I added other option to call, but I got error !!!

Few are ok other produce the following errors


Not enough actual parameters a position 199:23 BEFORE '('   just after OnShow

procedure frmreports_CheckBox1_OnClick (Sender: TObject);
begin
     if ((frmreports.CheckBox1.Checked = true ) or  (frmreports.CheckBox1.Checked = false )) then frmreports.Button1.Click;
     frmreports_OnShow(nil, '');    //  Bug ???          frmdons_Onshow(nil, ''); ok in other procedure ?
     //frmreports_TableGrid1_OnCellDoubleClick(nil, ''); //  Bug  too ???
end;

Regards

Post's attachments

Attachment icon Error.png 77.25 kb, 127 downloads since 2019-08-08 

Re: How to call from form1 procedure form2_OnClose

Attach your project.

Dmitry.