Table of Contents

Method InsertSpeedBtnCore

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

InsertSpeedBtnCore(int, ItemKind, string?, ImageSet?, ImageSet?, string?, EventHandler?)

Inserts a new SpeedButton into the collection at the specified index.

public virtual SpeedButton InsertSpeedBtnCore(int index, ToolBar.ItemKind itemKind, string? text, ImageSet? imageSet, ImageSet? imageSetDisabled, string? toolTip = null, EventHandler? action = null)

Parameters

index int

The zero-based index at which the SpeedButton should be inserted.

itemKind ToolBar.ItemKind

The kind of item represented by the SpeedButton. This determines its behavior and appearance.

text string

The text to display on the SpeedButton. If null, an empty string is used.

imageSet ImageSet

The image set to display on the SpeedButton. Can be null if no image is required.

imageSetDisabled ImageSet

The image set to display when the SpeedButton is disabled. Can be null.

toolTip string

The tooltip text to display when the user hovers over the SpeedButton. If null, the value of text is used.

action EventHandler

An optional event handler to invoke when the SpeedButton is clicked or double-clicked. Can be null.

Returns

SpeedButton

The newly created SpeedButton instance that was inserted into the collection.

Remarks

The SpeedButton is configured with default padding, alignment, and margins. If imageSetDisabled is provided, it is used as the image set for the disabled state. If action is provided, it is attached to both the click and double-click events of the SpeedButton.