How to get controls in WPF to fill available space?

There are also some properties you can set to force a control to fill its available space when it would otherwise not do so. For example, you can say:

HorizontalContentAlignment="Stretch"

… to force the contents of a control to stretch horizontally. Or you can say:

HorizontalAlignment="Stretch"

… to force the control itself to stretch horizontally to fill its parent.

Leave a Comment