Skip to content

Button Class

Simple button control with a height of 1.

C#
[DataContract]
public class Button : ButtonBase

Inheritance objectControlBaseButtonBase

Creates an instance of the button control with the specified width and height.

C#
public Button(int width, int height = 1)

width int
Width of the control.

height int
Height of the control (default is 1).

Creates an auto sizing button with the specified text.

C#
public Button(string text)

text string
The text to display on the button.

When true, renders the “end” glyphs on the button.

C#
[DataMember]
public bool ShowEnds { get; set; }

The theme state used with the left end of the button.Defaults to ’<’.

C#
[DataMember]
public int LeftEndGlyph { get; set; }

The theme state used with the right end of the button. Defaults to ’>’.

C#
[DataMember]
public int RightEndGlyph { get; set; }

The theme state used with the left end of the button.

C#
public ThemeStates EndsThemeState { get; protected set; }

Updates the ThemeState by calling RefreshTheme(Colors) with the provided colors. Override this method to adjust how colors are used by the ThemeState.

C#
protected override void RefreshThemeStateColors(Colors colors)

colors Colors
The colors to apply to the theme state.

Redraws the control if applicable.

C#
public override void UpdateAndRedraw(TimeSpan time)

time TimeSpan
The duration of thecurrent frame.

Resizes the control surface based on AutoSize or the Width and Height properties.

C#
protected override ICellSurface CreateControlSurface()

ICellSurface
The control’s surface.