Skip to content
ConsoleMonster
Class

Button

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

A keyboard action button whose value counts activations.

Inheritance

Usage

Explore 16 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 8

Constructors

public Button(string name, string? label = null) #

Creates an action button.

Parameters

name string required
The application-state key.
label string? = null optional
The caption; null uses the name.

Properties

public int Value { get; } #

The number of handled Enter or Space activations, initially zero.

Events

public event EventHandler? Clicked #

Raised synchronously once per activation, after releasing the control's state lock.

Extension Methods

public static Button WithEnabled(Button button, bool value = true) #

Sets InputControl.Enabled: Whether the control accepts input and participates in focus traversal.

Parameters

button ConsoleMonster.Interactive.Button required
The instance.
value bool = true optional
The value (default true).

Returns

Button The same instance.
public static Button WithLabel(Button button, string? value) #

Sets InputControl.Label: The visible label, or null to use the name.

Parameters

button ConsoleMonster.Interactive.Button required
The instance.
value string? required
The value.

Returns

Button The same instance.
public static Button WithTabIndex(Button button, int value) #

Sets InputControl.TabIndex: Focus order; equal values preserve declaration order.

Parameters

button ConsoleMonster.Interactive.Button required
The instance.
value int required
The value.

Returns

Button The same instance.
public static Button WithValidationMessage(Button button, string? value) #

Sets InputControl.ValidationMessage: The current validation message below the control, or null.

Parameters

button ConsoleMonster.Interactive.Button required
The instance.
value string? required
The value.

Returns

Button The same instance.