Method AddButton
- Namespace
- Alternet.Scripter.Debugger.UI.AlternetUI
- Assembly
- Alternet.Scripter.Debugger.UI.AlternetUI.v10.dll
AddButton(string, string, Keys, Action?, LightDarkColor?)
Adds a button to the toolbar with the specified text, image resource, keyboard shortcut, and action.
public virtual ObjectUniqueId AddButton(string text, string resName, Keys keys, Action? action, LightDarkColor? color = null)
Parameters
text
stringThe text displayed on the button. Underscores in the text are removed to create a hint for accessibility.
resName
stringThe name of the image resource to associate with the button. If
resName
is null or empty, no image is used.keys
KeysThe keyboard shortcut assigned to the button for quick access.
action
ActionThe action to execute when the button is clicked. Can be null if no action is required.
color
LightDarkColorAn optional color override for the button's image. If null, the default color is used.
Returns
- ObjectUniqueId
An ObjectUniqueId representing the unique identifier of the added button.
Remarks
The button's image is created using the specified resource name
and can be
color-customized if color
is provided.
If keys
is specified, the
button is assigned a keyboard shortcut for easier access.