Table of Contents

Class GroupBox

Namespace
Alternet.UI
Assembly
Alternet.UI.dll

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

[ControlCategory("Containers")]
public class GroupBox : Control, IBaseObject, IDisposableObject, IInputElement, ISupportInitialize, IFocusable, IWin32Window, ITextProperty, IComponent, IDisposable
Inheritance
GroupBox
Implements
Extension Methods

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.

Title

Gets or sets the title text for this group box.

Methods

GetOtherBorderForSizer()

Gets the margin on all other sides except top side.

GetTopBorderForSizer()

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

OnTitleChanged(EventArgs)

Called when the value of the Title property changes.

Events

TitleChanged

Occurs when the value of the Title property changes.