Table of Contents

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 string

The text displayed on the button. Underscores in the text are removed to create a hint for accessibility.

resName string

The name of the image resource to associate with the button. If resName is null or empty, no image is used.

keys Keys

The keyboard shortcut assigned to the button for quick access.

action Action

The action to execute when the button is clicked. Can be null if no action is required.

color LightDarkColor

An 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.