views:

17

answers:

1

I have 2 controls in a resize-able panel (1 datagridview and 1 textbox) with some space betwen and I need them both to scale in all directions with the panel. Problem is, since they're vertically stacked they run into each other when the panel scales vertically. I think I need some way to scale vertically while keeping the same ratio of the total panel size (ie, if the panel is scaled 2x, each control is scaled 2x) instead of anchoring them to all sides. Using C# if that matters, but I'm hoping for a non-programmatic solution.

+2  A: 

A TableLayoutPanel was designed to provide this kind of scaling support. You'll need three rows with the middle one Absolute and the top and bottom Percent. Dock fill the controls in the rows, the rest is automatic.

Hans Passant
Perfect, thanks!
Travis Christian