Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,710 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Very simple request. How do I make (or can I make) a GroupBox size to its content.
I have a groupbox which contains a number of items in a stackpanel. If I add a value then the GroupBox will not show the value. I have tried with height and width set to Auto but that does not work.
Check an example:
<GroupBox Margin="10,10,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Padding="10">
<StackPanel>
<CheckBox x:Name="checkBox1" Content="CheckBox1" />
<CheckBox x:Name="checkBox2" Content="CheckBox2" />
<CheckBox x:Name="checkBox3" Content="CheckBox3" />
</StackPanel>
</GroupBox>