Open Form2 side by side with Form1 simultaneously and close or minimize both simultaneously

6

I need to open 2 forms simultaneously next to each other and then when I close or minimize one of them, the 2 are closed / minimized simultaneously. I looked for some idea on several sites and all I found so far was the following code that shows "Form2" in the lower right corner of the screen.

Follow the code below:

// Form 1

procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.show;
end;


// Form 2

procedure TForm2.FormShow(Sender: TObject);
begin
Form2.TOP:= SCREEN.WorkAreaHeight - Form2.HEIGHT;
Form2.LEFT:=SCREEN.WorkareaWidth - Form2.WIDTH;
end;

Does anyone have any idea how to achieve this goal?

    
asked by anonymous 22.09.2015 / 02:00

3 answers

0

If you use MDI, you can find the answer link

In the case of using form, I believe there is control. Some details that may help in this case. 1) You will need to know the total size of the monitor screen 2) the size of each form 3) deduct from the total size of each size you want to have the window

    
24.09.2015 / 16:10
0

Maybe a new approach will be more efficient.

1 - You have the 1 screen called form1

2 - You have the 2 screen called form2

3 - Create a third screen with 2 panels, each with the dimensions of form1 and form2

4 - In the formshow of this screen (form3), Make a create on form1 by placing parent for panel1. Then do a create on form2 by putting parent to panel2.

Forms will be created within each panel.

I hope it helps.

    
09.12.2015 / 00:59
0

Friend, use the component JvFormMagnet it does this job, for you, basically you put one in each form, arrow the property "FormMagnet" to true, and in the second form vc arrow "MainFormMagnet" to true tb. do some testing and see the magic!

    
06.06.2018 / 22:03