Table of Contents

Class Button

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Button is a View that provides an item that invokes raises the Accept event.

public class Button : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Inheritance
Button
Implements
Inherited Members

Remarks

Provides a button showing text that raises the Accept event when clicked on with a mouse or when the user presses SPACE, ENTER, or the HotKey. The hot key is the first letter or digit following the first underscore ('_') in the button text.

Use HotKeySpecifier to change the hot key specifier from the default of ('_').

When the button is configured as the default (IsDefault) and the user presses the ENTER key, if no other View processes the key, the Button's Accept event will be fired.

Set WantContinuousButtonPressed to true to have the Accept event invoked repeatedly while the button is pressed.

Constructors

Button()

Initializes a new instance of Button using Computed layout.

Properties

HotKeySpecifier

Gets or sets the specifier character for the hot key (e.g. '_'). Set to '\xffff' to disable automatic hot key setting support for this View instance. The default is '\xffff'.

IsDefault

Gets or sets whether the Button is the default action to activate in a dialog.

NoDecorations
NoPadding
Text

The text displayed by the View.

WantContinuousButtonPressed

Gets or sets whether the View wants continuous button pressed events.

Methods

PositionCursor()

Positions the cursor in the right position based on the currently focused view in the chain.

UpdateTextFormatterText()

Can be overridden if the Text has different format than the default.