rakete
rakete

Reputation: 3041

How can I set the height of a WPF-Control to the maximum which is available?

For example: I have a Stackpanel with height of 200px. In this panel a grid with a height of 50px. How can I add a control (for example a textblock), which use the complete rest of height (150px) and not only the height of the textfont?

Upvotes: 0

Views: 490

Answers (1)

Klaus Byskov Pedersen
Klaus Byskov Pedersen

Reputation: 120937

Use a DockPanel instead. The last item added to a DockPanel takes up remaining space.

Upvotes: 2

Related Questions