Property HasFocus | Terminal.Gui v2 (original) (raw)

Gets or sets whether this view has focus.

See the View Navigation Deep Dive for more information:https://gui-cs.github.io/Terminal.GuiV2Docs/docs/navigation.html

Only Views that are visible, enabled, and have CanFocus set to true are focusable. If these conditions are not met when this property is set to true HasFocus will not change.

Setting this property causes the OnHasFocusChanging(bool, bool, View?, View?) and OnHasFocusChanged(bool, View?, View?) virtual methods (and HasFocusChanging andHasFocusChanged events to be raised). If the event is cancelled, HasFocus will not be changed.

Setting this property to true will recursively set HasFocus totrue for all SuperViews up the hierarchy.

Setting this property to true will cause the subview furthest down the hierarchy that is focusable to also gain focus (as long as TabStop

Setting this property to false will cause AdvanceFocus(NavigationDirection, TabBehavior?) to set the focus on the next view to be focused.