Method AddButton
AddButton(string, Action?)
Adds a new button with the specified text and click action to the panel.
public virtual Button AddButton(string text, Action? clickAction = null)
Parameters
textstringThe text to display on the button. Cannot be null or empty.
clickActionActionThe action to execute when the button is clicked. Can be null.
Returns
Exceptions
- ArgumentException
Thrown if
textis null or empty.
AddButton(KnownButton, Action?)
Adds a new button to the current container with the specified behavior.
public virtual Button AddButton(KnownButton button, Action? clickAction = null)
Parameters
buttonKnownButtonA KnownButton value that specifies the type of button to add.
clickActionActionAn Action to be executed when the button is clicked.
Returns
Remarks
The button's text is determined by the specified
button type. The
clickAction is invoked whenever the button is clicked.
The new button is added as a child to the panel.