user316117
user316117

Reputation: 8271

Can a StackPanel set itself to the height of its content?

I have WPF StackPanel which I want to resize its height according to the height of its contents. Is there any native way to do this? StackPanel doesn't seem to support "SizeToContent"

Thanks in advance!

Upvotes: 1

Views: 261

Answers (1)

Jay
Jay

Reputation: 57919

StackPanel will always grow and shrink according to its contents, but what you end up seeing could be constrained by what contains the StackPanel, such as a Window.

Upvotes: 3

Related Questions