Panel
Panel
A Panel is a container object used to organize, manage, and move other controls (buttons, labels, text boxes, etc.) as a logical group.
A Panel is typically invisible (BorderStyle = None), but it forms the structural foundation of many screen layouts.
Common Use Cases
- Visibility Management
The primary method for showing or hiding a group of controls using a single tag. A Panel (and all 10 controls inside it, for example) can be controlled with one tag.
- Control Grouping
Keeps related controls together (e.g., “Motor 1 Start”, “Motor 1 Stop”, “Motor 1 Status”), helping maintain a clean and organized layout.
- RadioButton Grouping
Placing multiple RadioButtons inside a Panel automatically groups them, allowing only one to be selected at a time.
- Scrolling
When the Panel’s AutoScroll property is set to True, scroll bars automatically appear to allow viewing of controls that exceed the Panel’s size.
Basic Configuration and Behavior
- Design
Drag and drop other controls (Button, Label, etc.) onto a Panel. These controls will appear as children of the Panel in the project tree.
- Management (Properties Panel)
The Panel’s Properties panel allows batch control over all objects inside it.
Properties Panel – Key Properties
Visible
- Function: The primary use of a Panel in SCADA.
When bound to a tag and condition, the Panel (and all controls inside it) becomes visible or hidden based on that tag value. - Use Case: Creating pop-up windows.
Enabled
- Function: Bind the Panel’s Enabled property to a tag (e.g., User_Access < 5) to disable all controls inside the panel at once.
Layout
- Function: By binding the Panel’s X or Y coordinates to dynamic tags, sliding menus can be created.
Advanced Panel – Key Properties
BorderStyle
- None (Default): The Panel is invisible and used only as a grouping area.
- FixedSingle: Draws a thin solid line around the Panel (useful when mimicking a group box).
- Fixed3D: Gives the Panel a recessed or raised 3D appearance.
AutoScroll
When set to True, scroll bars automatically appear when the content inside the Panel exceeds its size (e.g., very long Labels or large PictureBoxes).
BackColor
Sets the background color of the Panel, helping visually separate the grouped area from other screen elements.
Usage Examples
Example 1: Creating a Pop-up Settings Window
- Add a Panel to the screen. Set BorderStyle = FixedSingle and configure a suitable BackColor.
- Add TextBoxes, Labels, and a “Close” button inside the Panel.
- Add a “Settings” button to the main screen.
- Bind the Panel’s Properties → Visible property to a tag (Tag_1).
- In the “Settings” button’s Mouse Down event, set:
- Tag_1 = “true”
- In the Panel’s close button Mouse Down event, set:
- Tag_1 = “false”
Result:
Pressing the Settings button sets the tag to True and the Panel becomes visible as a pop-up.
Pressing the close button sets the tag to False, hiding the Panel again.
Example 2: Disabling Controls Based on User Authorization
- Add a Panel to the screen.
- Place inside it only the controls intended for authorized users.
- Open Properties → Enabled.
- Add a New Condition:
- Condition: UserLevel = “5”
Result:
If the user level is below 5, the Panel (and all controls inside it) becomes disabled (grayed out and non-interactive).
When a user with UserLevel = “5” logs in, the panel and its controls become active.
