enforce WPF ContentControls to have maximum width

423 Views Asked by At

I have ContentControls like ComboBox and TextBox inside of a Grid or a StackPanel. I want them to have the maximum possible width. How do I achieve that? I've noticed that Button has maximum width any way when it is added to a StackPanel, but ComboBox and TextBox do not. I've tried setting ContentControls' Width="*", but that doesn't work.

1

There are 1 best solutions below

0
On BEST ANSWER

Did you try HorizontalAlignment="Stretch"?