Table of Contents

Class SpeedButton

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

Implements speed button control.

[ControlCategory("Other")]
public class SpeedButton : GraphicControl, IBaseObject, IDisposableObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, INotifyDataErrorInfo
Inheritance
SpeedButton
Implements
Derived

Examples

Here is how to declare a SpeedButton in UIXML:

<SpeedButton Name="button1" Click="Button_Click" HorizontalAlignment="Right"
             ToolTip = "Some hint" Shortcut="Ctrl+O" Text="Ok" TextVisible="true"/>

Also, a SpeedButton can be created from code:

public SpeedButton CreateSpeedButton()
{
    SpeedButton result = new()
    {
        Text = "Cancel",
        TextVisible = true,
        ToolTip = "Some hint",
        Parent = buttonPanel,
        ShortcutKeys = Keys.Control | Keys.A,
        Name = "cancelBtn",
        Enabled = false,
        HorizontalAlignment = HorizontalAlignment.Right,
    };
    result.ImageSet = KnownSvgImages.ImgCancel.AsNormal(32, result.IsDarkBackground);
    result.DisabledImageSet = KnownSvgImages.ImgCancel.AsDisabled(32, result.IsDarkBackground);
    result.Click += Button_Click;
    return result;
}

Remarks

Example of how a SpeedButton can look:

SpeedButton

Constructors

SpeedButton()

Initializes a new instance of the SpeedButton class.

Fields

DefaultCustomTheme

Gets or sets default color and style settings for all SpeedButton controls which have UseTheme equal to Custom.

DefaultImageLabelDistance

Gets or sets default image and label distance in the SpeedButton.

DefaultTheme

Gets or sets default color and style settings for all SpeedButton controls which have UseTheme equal to Default.

DefaultUseTheme

Gets ot sets default value of UseTheme property.

StaticBorderTheme

Gets or sets default color and style settings for all SpeedButton controls which have UseTheme equal to StaticBorder.

TabControlTheme

Gets or sets default color and style settings for all SpeedButton controls which have UseTheme equal to TabControl.

Properties

AllChildrenInLayout

Gets all child controls which are visible and included in the layout.

ClickAction

Gets or sets Action which will be executed when this control is clicked by the user.

CustomTheme

Gets or sets default color and style settings for all SpeedButton controls which have UseTheme equal to Custom.

DefaultShortcutToolTipTemplate

Gets or sets default template for the shortcut when it is shown in the tooltip.

DisabledImage

Gets or sets the disabled image that is displayed by the control.

DisabledImageSet

Gets or sets the disabled ImageSet that is displayed by the control.

Enabled

Gets or sets a value indicating whether the control can respond to user interaction.

HideToolTipOnClick

Gets or sets whether ToolTip will be hidden when control is clicked. Default is true.

Image

Gets or sets the image that is displayed by the control.

ImageSet

Gets or sets ImageSet that is displayed by the control.

ImageToText

Gets or sets a value which specifies display modes for item image and text.

ImageVisible

Gets or sets a value indicating whether to draw image.

IsClickRepeated

Gets or sets whether mouse clicks are repeated continiously while left mouse button is pressed.

Shortcut

Gets or sets a value indicating the associated shortcut key.

ShortcutKeyInfo

Gets or sets a value indicating the associated shortcut key.

ShortcutKeys

Gets or sets the associated shortcut keys.

ShortcutToolTipTemplate

Gets or sets template for the shortcut when it is shown in the tooltip.

Sticky

Gets or sets whether control is sticky.

Text

Gets or sets the text associated with this control.

TextVisible

Gets or sets whether to display text in the control.

UseDefaultTheme

Gets or sets whether to use DefaultTheme.

UseTheme

Gets or sets whether to use DefaultTheme.

VisualState

Gets current VisualControlState.

Methods

CreateBorders(Color)

Creates borders for the SpeedButton using default border width and using specified color.

DefaultPaint(Graphics, RectD)

Default painting method of the UserControl and its descendants.

DisposeManaged()

Override to dispose managed resources. Here we dispose all used object references.

GetDefaultTheme()

Gets default color and style settings.

GetRealToolTip()

Gets ToolTip value for use in the native control.

GetShortcuts()

Adds list of shortcuts associated with the control and its child controls. Only visible and enabled child controls are queried.

InitThemeDark(ControlStateSettings)

Initializes default colors and styles for the SpeedButton using 'Dark' color theme.

InitThemeLight(ControlStateSettings)

Initializes default colors and styles for the SpeedButton using 'Light' color theme.

LoadSvg(string, SizeI)

Loads normal and disabled image from the specified file or resource url. Loaded images assigned to ImageSet and DisabledImageSet properties.

OnMouseDown(MouseEventArgs)

Called when the mouse button was pressed.

OnVisualStateChanged(EventArgs)

Called when VisualStateChanged property is changed.

ParentDisposed()

Called when parent is disposed.