Group Box can contain single control?

Aug 21, 2009 at 9:47 AM

Does the group box can accomodate only one control? I get a error when I try to include three check boxes inside a group box.

Aug 22, 2009 at 5:15 PM

Yes, you can only add one child directly to the groupbox control. However, to add more all you have to do is put a grid or stackpanel inside the groupbox and add multiple children to that control.

For example:

<groupbox:GroupBox Header=”Header goes here”>
    <StackPanel>

         <CheckBox Content="Red"/>

         <CheckBox Content="Blue"/>

         <CheckBox Content="Green"/>

    </StackPanel>
</groupbox:GroupBox>