Friday, October 01, 2010

Making things stretch in WPF

I quote from a StackOverflow reply by one Matt Hamilton:
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.
That should come in handy in future.