Jump to content

Question about form layout on changing orientation


Recommended Posts

I have a working application that uses frames. That is, when the user selects some option from the menu, the programs loads a frame into the client area of the application.In some of the frame, I have 3 controls - one aligned to the top, the other bottom and the other in the middle.


When the "page" is loaded, I set (calculate) the height of the control at the bottom so the components at the bottom and middle are the same height.


This works if the page starts in "portrait" mode or "landscape".


But if the user the switches from "portrait" to  "landscape" or vice versa, a screen resize event fires on main form.


Now what I am presently thinking is for the components to resize correctly, I would need to add code to the frame(s) so work out the resizes the components in the frame based on the orientation, which would be executed during the resize event on the main form. The only downside to this is the number of different frames that can be displayed.


Or is there a better way to specify the size of components in a frame such as based on percentage?


Any tips?


Thanks in advance.




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.

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...