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
textstringThe text displayed on the button. Underscores in the text are removed to create a hint for accessibility.
resNamestringThe name of the image resource to associate with the button. If
resNameis null or empty, no image is used.keysKeysThe keyboard shortcut assigned to the button for quick access.
actionActionThe action to execute when the button is clicked. Can be null if no action is required.
colorLightDarkColorAn 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.