GroupBox
GroupBox
A GroupBox is a container object that organizes other controls (buttons, labels, etc.) into a logical group, similar to a Panel.
The key difference from a Panel is that a GroupBox comes with a default border and a header (defined by the Text property). This makes it ideal for visually separating related controls on the screen.
Common Use Cases
- RadioButton Grouping
When multiple RadioButtons are placed inside a GroupBox, they automatically form a single selection group, allowing only one of them to be selected at a time.
- Visual Organization
For example, grouping all controls of a motor (“Start”, “Stop”, “Speed Adjustment”) inside a GroupBox and setting its Text property to “Motor 1 Control Panel” provides clear visual structure.
- Batch Management
As with a Panel, you can manage the entire group’s Visible or Enabled states through a single tag.
Basic Configuration and Behavior
- Design
Drag and drop other controls (Button, Label, etc.) into a GroupBox.
- Labeling (Advanced Panel)
Set the GroupBox’s Text property to define the group’s title (e.g., “Operating Mode”).
- Control (Properties Panel)
Bind the GroupBox’s Visible or Enabled properties to a tag to affect all controls inside it collectively.
Properties Panel – Key Properties
Text (Caption / Header)
- Function: Allows binding the GroupBox header to a String tag dynamically.
- Use Case: When an operator selects “Machine 1” from a ComboBox, the GroupBox header can automatically update to “Machine 1 Settings”.
Visible
- Function: Controls whether the GroupBox (and all controls inside it) is shown or hidden, based on a Boolean tag.
Enabled
- Function: When the GroupBox’s Enabled property is set to False, all controls inside it (buttons, text boxes, etc.) automatically become disabled (non-clickable/non-editable).
Advanced Panel – Key Properties
Text
Defines the group’s header at design time.
BackColor
Sets the background color of the GroupBox.
ForeColor
Defines the color of the GroupBox’s header text.
Note: Unlike a Panel, a GroupBox does not have an AutoScroll feature. It is designed primarily for grouping and captioning content rather than scrolling it.
Usage Examples
Example 1: Mode Selection with RadioButtons (Common Scenario)
This is the most typical and essential usage for a GroupBox.
- Add a GroupBox to the screen.
- In Advanced → Text, set the header to “Running Mode”.
- Drag the following RadioButtons into the GroupBox:
- RadioButton_0 (Text: “Manual”)
- RadioButton_1 (Text: “Automatic”)
- RadioButton_2 (Text: “Maintenance”)
Result: All three RadioButtons now belong to the same group. When the operator selects “Automatic”, the “Manual” and “Maintenance” selections are automatically cleared.
(For tag-binding rules, see the RadioButton documentation.)
Example 2: Hiding a Settings Section Based on User Level
- Add a GroupBox to the screen.
- Place inside it only the controls intended for authorized users.
- Open Properties → Visible.
- Add a New Condition:
- Condition: UserLevel = “5”
Result: When the screen loads, the GroupBox (and everything inside it) is hidden for normal users.
It becomes visible only when the logged-in user’s UserLevel equals “5”.
