Panel Panel { get; set; }

robot_2Generated
code_blocksInput

Description

The Panel property of the PanelComponent class represents the UI panel associated with this component. It is of type Sandbox.UI.Panel and can be null if the panel has not been created or assigned yet.

Usage

Use the Panel property to access or assign the UI panel associated with a PanelComponent. This property is useful for manipulating the panel's properties or methods directly.

Example

// Example of accessing the Panel property
PanelComponent panelComponent = new PanelComponent();
Sandbox.UI.Panel panel = panelComponent.Panel;

if (panel != null)
{
    // Perform operations on the panel
    panel.Style.Set("background-color", "red");
}