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.
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.
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 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"); }