I defined a Window in WPF, into this one I put a “stack panel” and inside this panel I put a “tab control” and some “button controls”.
When executing the program, I would like that when I have to resize the window using the mouse, the stack panel and all controls inside it can also be resized automatically and proportionally to the window.
How can I get this?
Thanks!!
A
StackPanelonly uses the space that its child controls need; it does not resize to the available space of the window.If you want this behavior, use a different type of panel: If you only want the tab control to resize, use a
DockPaneland make the tab control the last child of the DockPanel. A DockPanel stretches to the available space of the parent, with the last child getting all the space not used by the previous children.If you need more complex spacing behavior (for example, you want the Buttons to proportionally take up more space as well), have a look at the
Gridcontrol.