1 (edited by malitos 2021-05-12 04:02:51)

Topic: Resize Form

Hi everyone. Please tell me what is my mistake? There is a form frmStart it is the main one, it has a button Button1 when it is clicked, the form Form1 appears but it must be inside the form frmStart while its position must be within the size of the table on the form frmStart


procedure frmStart_OnShow (Sender: TObject; Action: string);
begin
    Form1.Parent:= Form1;
    Form1.Align:= alCustom;
end;

procedure frmStart_OnResize (Sender: TObject);
begin
    if Form1 <> nil then
    begin
        Form1.Left:= frmStart.ClientWidth div 2 - Form1.Width div 2;
        Form1.Top:= frmStart.ClientHeight div 2 - Form1.Height div 2;
    end;
end;

procedure frmStart_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
     Form1.Show;
     Form1.Parent:= frmStart;
     Form1.Align:= alCustom;
     Form1.Position:= poMainFormCenter;
end;
procedure frmStart_OnClose (Sender: TObject; Action: string);
begin
    Form1:= nil;
end;

begin
end.

Post's attachments

Attachment icon Form1.jpg 76.67 kb, 125 downloads since 2021-05-12 

Re: Resize Form

Can it be done somehow via Panel attach Form1 when opening to the panel Please help sad

Re: Resize Form

malitos wrote:

Can it be done somehow via Panel attach Form1 when opening to the panel Please help sad

upload your project

Re: Resize Form

Please

Post's attachments

Attachment icon form.rar 293.37 kb, 255 downloads since 2021-05-13 

5 (edited by sibprogsistem 2021-05-13 06:55:25)

Re: Resize Form

.

Post's attachments

Attachment icon test.rar 4.33 kb, 283 downloads since 2021-05-13 

Re: Resize Form

Thank you so much. Works

Re: Resize Form

Can I ask you a moment again? If you need to see a photo from the Form1 Form table on the Start form, the script I threw something but it doesn't work sad

Post's attachments

Attachment icon test2.rar 4.61 kb, 249 downloads since 2021-05-13 

8 (edited by sibprogsistem 2021-05-13 12:04:12)

Re: Resize Form

malitos wrote:

Can I ask you a moment again? If you need to see a photo from the Form1 Form table on the Start form, the script I threw something but it doesn't work sad

frmStart.GridClients.dbItemID

GridClients

you do not have a table with that name

Re: Resize Form

sibprogsistem wrote:
malitos wrote:

Can I ask you a moment again? If you need to see a photo from the Form1 Form table on the Start form, the script I threw something but it doesn't work sad

frmStart.GridClients.dbItemID

GridClients

you do not have a table with that name

Thank you for seeing the error. You corrected me the above project, where I added 2 windows is it possible to write a script for adding several windows? and if it is not difficult to tell me why they are all opened differently, I would like that when you click on the button, all forms 1 2 3 are equally exactly in relation to the main form

Post's attachments

Attachment icon Form.rar 294 kb, 260 downloads since 2021-05-14 

Re: Resize Form

Because when you click expand Form1 or Form2, you can't see the borders at the bottom of the screen. It is possible to make it there so that when you expand or weld frmStart while Form1 or Form2 were fully visible ( which was visible on the right side and the lower basement)

Re: Resize Form

malitos wrote:

Because when you click expand Form1 or Form2, you can't see the borders at the bottom of the screen. It is possible to make it there so that when you expand or weld frmStart while Form1 or Form2 were fully visible ( which was visible on the right side and the lower basement)

To further understand my idea, I will say that you need to make sure that when you scan the frmStart form to full screen, the other forms also adjust to the size of the frmStart. When I click on expand the main window, Form1 remains partially expanded and as it was before the deployment, while if you click on the Button that calls the form again, the window becomes normal size (full screen) The question is why do I need to click the form call button again to get the desired size?

Re: Resize Form

The script probably needs to be written: Click expand the window button 1 is triggered back click in the normal state button 1 is triggered is this possible?

Re: Resize Form

Everything seems to be sorted out just added a script to each form that opens in the main form:

procedure Form1_OnResize (Sender: TObject; Action: string);
begin
  Form1:=frmStart.Panel4.Left;
  Form1.Top:=frmStart.Panel4.Top;
  Form1.Width:=frmStart.Panel4.Width;
  Form1.Height:=frmStart.Panel4.Height;
end;

Now when we open the Form1 button it adjusts to the size of Panel 4 smile

14 (edited by sibprogsistem 2021-05-14 15:37:32)

Re: Resize Form

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;item=7709&amp;download=0

Post's attachments

Attachment icon Безымянный22.png 59.44 kb, 118 downloads since 2021-05-14 

15 (edited by malitos 2021-05-17 10:10:18)

Re: Resize Form

Hello again. There was a problem with clicking on the edit field. There is a main window in it, three forms are displayed on the buttons that open in the main window. The problem is that when you open the child forms when you click on the edit field the left mouse button does not work but the right one works tell me what is the reason? Project attached.

Post's attachments

Attachment icon WTF.rar 293.22 kb, 304 downloads since 2021-05-17 

Re: Resize Form

Install  BorderStyle -> bsNone  for Form1, Form2,Form3

Re: Resize Form

sibprogsistem wrote:

Install  BorderStyle -> bsNone  for Form1, Form2,Form3

Thanks bro