resizing panel to fit all controls
Hello,
I'm thinking there must be a way to tell a panel to resize to exactly the size required for all its controls to be visible. So if it's too big, it shrinks to fit all the controls snugly, and if it's too small, it grows so that all the controls can be seen.
How can I do this?
Re: resizing panel to fit all controls
I would calculate the percentage of the hight and width the control takes compared to the panel. Then when the panel resizes I would resize all the controls in the panel to the same percentage. Don't forget to subtract spacing of your controls from the panel size when making calculations and also remeber to place controls based on the new size of its neigbor controls.