Jump to content

Resizing the form when resizing the browser window


artem_niko

Recommended Posts

Good afternoon!
Such a situation.
I need UniForm1 to display the same dimensions as the UniPageControl parent for UniForm1. In general, what kind of algorithm I do actions.
1. Assign the parent and the dimensions Width and Height to UniForm1, before displaying it:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  F_LaunchedModule.Parent:=UniPageControl1;
  F_LaunchedModule.Height:=UniPageControl1.Height;
  F_LaunchedModule.Width:=UniPageControl1.Width;
  F_LaunchedModule.Show();
end;


2. When changing the size of the browser window, you need to change the size of UniForm1 to the size of the UniPageControl, i.e. the parent. 

Now it turns out that when you change the size of the browser window, the dimensions of the UniForm1 form do not change, they remain the same as the values received in paragraph No. 1 of the algorithm above.

 

How to make UniForm1 change its size if the browser window size has changed, and hence its parent (UniPageControl)?

I watched the demo from the uniGUI\Framework\uniGUI\Demos\Desktop\Form With Parent 5 folder, made the settings as in the example, but the size does not change anyway

Link to comment
Share on other sites

11 hours ago, Sherzod said:

I know you don't like creating test cases. But, if you create, we could check your case. Otherwise, you should analyze the related demos.

Another idea came to mind: you can transfer the dimensions of the parent when the dimensions of the main form (MainForm) change. 
What event is responsible for this, so that when the browser window sizes change, and hence the MainForm sizes, then at this moment just pass the parent sizes to UniForm1?

Link to comment
Share on other sites

maybe this is not the solution you need, but after seeing several posts over the years about responsiveness, I set up a base project (actually there are 5) where I managed to solve your question and many others, such as controlling color themes, fonts and several other configurations, runtime translation etc and also use only one code, only one form/frame for desktop and mobile (no use of hybrid mobile) and best of all, without using html, css, js or extjs.

even though it's not what you're looking for, I leave the link where there are several demonstrative videos and of course, I'm at your disposal.

http://forums.unigui.com/index.php?/topic/22690-radcore-project/

ps: several unigui users (in several countries) already have applications in production (some with almost 3 years old) based on RadCORE.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...