Table of Contents

Interface IFocusableControl

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

Interface for controls that can receive focus

public interface IFocusableControl : IWindowControl, IDisposable
Inherited Members
Extension Methods

Properties

CanReceiveFocus

Whether this control can receive focus

bool CanReceiveFocus { get; }

Property Value

bool

HasFocus

Whether this control currently has focus

bool HasFocus { get; set; }

Property Value

bool

Methods

SetFocus(bool, FocusReason)

Sets focus to this control

void SetFocus(bool focus, FocusReason reason = FocusReason.Programmatic)

Parameters

focus bool

Whether to give or remove focus

reason FocusReason

The reason for the focus change

Events

GotFocus

Event fired when the control gains focus

event EventHandler? GotFocus

Event Type

EventHandler

LostFocus

Event fired when the control loses focus

event EventHandler? LostFocus

Event Type

EventHandler