views:

326

answers:

2

I have a Canvas inside of a StackPanel in my WPF Designer in Visual Studio 2008. At runtime I plan to resize the Canvas so its client rect is a certain size (borders and other parts are just added onto that size). When I resize the Canvas, will the Width/Height of the StackPanel adjust itself accordingly? This is important since I have other controls that align themselves based on the size of the stack panel.

+1  A: 

The size of the stack panel is dependent upon the cumulative sizes of the controls (plus margins) that live inside the stack panel.

So if your controls add up to 100px high, then the stack panel is only ever going to be 100px high.

ChrisF
A: 

Actually, a alternative choice would be using a Grid to allow resizing while regarding to define Columns/Rows according to your need.

Khaliloz