Table of Contents

Class GroupBox

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Represents a control that displays a frame around a group of controls with an optional title.

[ControlCategory("Containers")]
public class GroupBox : ContainerControl, IBaseObject, IDisposableObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, INotifyDataErrorInfo
Inheritance
GroupBox
Implements

Examples

Here is how to declare a GroupBox in UIXML:

<GroupBox Name="groupBox" Margin="16" Title="Button Group">

    <StackPanel Orientation="Vertical" Margin="5,0,0,0">
      <Button Text="Add Item" Name="addItemButton" Margin="0,3,0,0"/>
      <Button Text="Remove Item" Name="removeItemButton" Margin="0,3,0,0"/>
    </StackPanel>
</GroupBox>

Also, a ComboBox can be created from code:

var groupBox1 = new Alternet.UI.GroupBox { Title = "Horizontal Sliders" };
var panel2 = new Alternet.UI.StackPanel { Orientation = StackPanelOrientation.Vertical, Margin = new Thickness(5) };
groupBox1.Children.Add(panel2);

Remarks

The GroupBox displays a frame around a group of controls with or without a title. Use a GroupBox to logically group a collection of controls in a window. The group box is a container control that can be used to define groups of controls. The typical use for a group box is to contain a logical group of RadioButton controls. If you have two group boxes, each of which contains several option buttons (also known as radio buttons), each group of buttons is mutually exclusive, setting one option value per group. You can add controls to the GroupBox by using the Add method of the Children property.

Examples of how a GroupBox can look on different platforms:

Set Title property to specify the title text displayed on the control.

Properties

ControlKind

Returns control identifier.

Handler

Gets control handler.

Text

Gets or sets title. Same as Title property.

Methods

CreateHandler()

Creates a handler for the control.

GetOtherBorderForSizer()

Gets the margin on all other sides except top side.

GetPreferredSize(SizeD)

Retrieves the size of a rectangular area into which a control can be fitted, in device-independent units.

GetTopBorderForSizer()

Gets the top border (it is the margin at the top where the title is).