ClickableElement

Custom WinForms UI control panel with hover, click feedback, toggle states, and event handling.

ClickableElement(string Title)

Initializes a custom Windows Forms panel button element with hover, click, and toggle state styling.

C#
var element = new ClickableElement("Item 1");

ClickableElement SetEvent(Action Event)

Attaches a callback action to be invoked when the element is clicked.

C#
element.SetEvent(() => {
    MessageBox.Show("Element clicked!");
});

ClickableElement Toggle()

Toggles the active state of the element and updates its background color.

C#
element.Toggle();

string GetTitle()

Returns the display title text of the element.

C#
string title = element.GetTitle();

bool IsToggled()

Returns whether the element is currently in a toggled/active state.

C#
bool toggled = element.IsToggled();