Button Class
Definition
Section titled “Definition”Simple button control with a height of 1.
[DataContract]public class Button : ButtonBaseInheritance object → ControlBase → ButtonBase
Constructors
Section titled “Constructors”Button(int, int)
Section titled “Button(int, int)”Creates an instance of the button control with the specified width and height.
public Button(int width, int height = 1)Parameters
Section titled “Parameters”width int
Width of the control.
height int
Height of the control (default is 1).
Button(string)
Section titled “Button(string)”Creates an auto sizing button with the specified text.
public Button(string text)Parameters
Section titled “Parameters”text string
The text to display on the button.
Properties
Section titled “Properties”ShowEnds
Section titled “ShowEnds”When true, renders the “end” glyphs on the button.
[DataMember]public bool ShowEnds { get; set; }LeftEndGlyph
Section titled “LeftEndGlyph”The theme state used with the left end of the button.Defaults to ’<’.
[DataMember]public int LeftEndGlyph { get; set; }RightEndGlyph
Section titled “RightEndGlyph”The theme state used with the right end of the button. Defaults to ’>’.
[DataMember]public int RightEndGlyph { get; set; }EndsThemeState
Section titled “EndsThemeState”The theme state used with the left end of the button.
public ThemeStates EndsThemeState { get; protected set; }Methods
Section titled “Methods”RefreshThemeStateColors(Colors)
Section titled “RefreshThemeStateColors(Colors)”Updates the ThemeState by calling RefreshTheme(Colors) with the provided colors. Override this method to adjust how colors are used by the ThemeState.
protected override void RefreshThemeStateColors(Colors colors)Parameters
Section titled “Parameters”colors Colors
The colors to apply to the theme state.
UpdateAndRedraw(TimeSpan)
Section titled “UpdateAndRedraw(TimeSpan)”Redraws the control if applicable.
public override void UpdateAndRedraw(TimeSpan time)Parameters
Section titled “Parameters”time TimeSpan
The duration of thecurrent frame.
CreateControlSurface()
Section titled “CreateControlSurface()”Resizes the control surface based on AutoSize or the Width and Height properties.
protected override ICellSurface CreateControlSurface()Returns
Section titled “Returns”ICellSurface
The control’s surface.