Jump to content

Question about form layout on changing orientation


tcoates

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.

 

Tim

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...