New to Telerik UI for WinForms? Start a free 30-day trial

Extends ComponentBehavior to provide comprehensive input handling capabilities including mouse, keyboard, and gesture input processing for RadControl components.

ComponentInputBehavior specializes in managing all forms of user input for RadControl instances, building upon the base ComponentBehavior functionality. It handles mouse events (clicks, movement, hovering), keyboard input, touch gestures, and coordinates these inputs with the RadElement tree to provide proper event routing and state management.

Key responsibilities include:

  • Mouse event routing and element hit testing
  • Element selection and pressed state management
  • Mouse capture and release handling
  • Hover detection and element monitoring
  • Keyboard input processing and routing
  • Touch and gesture input handling
  • Input state coordination across the element hierarchy

The class maintains various input-related states such as which elements are hovered, pressed, or have captured mouse input, ensuring proper visual feedback and interaction behavior throughout the control's element tree.

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

C#
public class ComponentInputBehavior : ComponentBehavior, IDisposable

Inheritance: objectComponentBehaviorComponentInputBehavior

Derived Classes: RadSpreadsheetComponentInputBehaviorRadRibbonBar.RibbonBarInputBehaviorRadRibbonBarBackstageView.RibbonBackstageViewInputBehaviorRadRichTextEditorComponentInputBehaviorRadSyntaxEditorComponentInputBehavior

Implements: IDisposable

Inherited Members ComponentBehavior.ItemCaptureStateComponentBehavior.Dispose()ComponentBehavior.GetActivatedItem(Control, char)ComponentBehavior.GetActivatedItem(RadElement, char)ComponentBehavior.ProcessMnemonic(char)ComponentBehavior.GetThemedChildControlsList(Control, List<Control>)ComponentBehavior.GetValidChildControlByMnemonic(List<Control>, char)ComponentBehavior.GetMnemonicText(string)ComponentBehavior.ProcessMnemonicChar(char)ComponentBehavior.OnGotFocus(EventArgs)ComponentBehavior.OnLostFocus(EventArgs)ComponentBehavior.IsFocusWithin(RadElement)ComponentBehavior.SetElementValue(RadElement, RadProperty, object)ComponentBehavior.HideScreenTip()ComponentBehavior.DisposeKeyTips()ComponentBehavior.SetKeyMap()ComponentBehavior.InitializeKeyMap()ComponentBehavior.ResetKeyMap()ComponentBehavior.ResetKeyMapInternal()ComponentBehavior.GetKeyMapFocus()ComponentBehavior.SetInternalKeyMapFocus()ComponentBehavior.ReturnKeyMapFocus()ComponentBehavior.OnEnableKeyTipsChanged()ComponentBehavior.InitializeAdornerLayer()ComponentBehavior.DisposeAdornerLayer()ComponentBehavior.GetRootItems()ComponentBehavior.ActivateSelectedItem(RadItem)ComponentBehavior.ProcessUnmappedItems(List<RadItem>)ComponentBehavior.IsIndexOfItemKeyTip(RadItem, string)ComponentBehavior.IsExactMatch(RadItem, string)ComponentBehavior.IsPartOfKeyTip(Keys, string)ComponentBehavior.GetCurrentKeyMap(RadItem)ComponentBehavior.GetKeyFocusChildren(RadItem)ComponentBehavior.GetKeyStringRepresentation(Keys)ComponentBehavior.FocusedElementComponentBehavior.AllowShowFocusCuesComponentBehavior.ToolTipComponentBehavior.ToolTipOffsetYComponentBehavior.ToolTipOffsetXComponentBehavior.DefaultShowItemToolTipsComponentBehavior.ShowItemToolTipsComponentBehavior.ShowScreenTipsBellowControlComponentBehavior.CommandBindingsComponentBehavior.IsParentFormActiveComponentBehavior.EnableKeyMapComponentBehavior.MouseOverComponentBehavior.OwnerComponentBehavior.OwnerControlComponentBehavior.SelectedElementComponentBehavior.BitmapRepository...

Constructors

Initializes a new instance of the ComponentInputBehavior class for the specified component tree handler.

C#
public ComponentInputBehavior(IComponentTreeHandler owner)
Parameters:ownerIComponentTreeHandler

The IComponentTreeHandler that owns this input behavior instance.

The constructor calls the base ComponentBehavior constructor and initializes input-specific settings. By default, it enables item tooltips based on the ShowItemToolTips setting.

This constructor establishes the input handling system for the component, preparing it to process mouse, keyboard, and gesture input events and route them appropriately through the element tree.

Properties

Gets or sets a value indicating whether input processing is enabled for this component.

C#
[Browsable(false)]
public bool Enable { get; set; }
Property Value:

true if input events should be processed; otherwise, false. The default is true.

When this property is set to false, the component will not process mouse, keyboard, or other input events. This can be useful for temporarily disabling interaction during certain operations or states.

Gets the mouse hover timer used to detect and handle mouse hover events.

C#
protected MouseHoverTimer MouseHoverTimer { get; }
Property Value:

A MouseHoverTimer instance used for hover detection and timing.

This timer is used internally to manage mouse hover detection, determining when the mouse has remained stationary over an element long enough to trigger hover-related events and visual feedback such as tooltips.

Methods

Releases managed resources and references owned by this behavior.

C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

true to release managed resources; otherwise, release only unmanaged resources.

Overrides: ComponentBehavior.Dispose(bool)

Override this method to release resources owned by a derived behavior, and call the base implementation.

Gets the uppermost element in the current hover chain, preferring a non-box element when available.

C#
public RadElement GetHoveredRadElement()
Returns:

RadElement

The selected hovered element, or null when no hover chain is tracked.

Clears the previous hover selection while preserving parent-notified input when the new element is nested beneath it.

C#
protected void HandleMouseLeave(EventArgs e, RadElement elementUnderMouse)
Parameters:eEventArgs

The mouse event that caused the selection to change.

elementUnderMouseRadElement

The newly hit-tested element, if any.

Clears the current hover selection when the pointer leaves without another hit-tested element.

C#
protected void HandleMouseLeave(EventArgs e)
Parameters:eEventArgs

The mouse-leave event data.

Provides an override point for handling a click before the control's standard event processing.

C#
public virtual bool OnClick(EventArgs e)
Parameters:eEventArgs

The click event data.

Returns:

bool

false by default, allowing the control's standard event processing.

Provides an override point for handling a double-click before the control's standard event processing.

C#
public virtual bool OnDoubleClick(EventArgs e)
Parameters:eEventArgs

The double-click event data.

Returns:

bool

false by default, allowing the control's standard event processing.

C#
protected virtual void OnGesture(GestureEventArgs e)
Parameters:eGestureEventArgs

Raises HoveredElementChanged when the uppermost hovered element changes.

C#
protected virtual void OnHoveredElementChanged(HoveredElementChangedEventArgs e)
Parameters:eHoveredElementChangedEventArgs

The new uppermost hovered element.

Clears the captured-item reference, notifies the captured item, and forwards the notification to the owner.

C#
public virtual void OnMouseCaptureChanged(EventArgs e)
Parameters:eEventArgs

The mouse-capture event data.

Selects or uses the captured element, sends it mouse-down, and resets active key tips.

C#
public virtual bool OnMouseDown(MouseEventArgs e)
Parameters:eMouseEventArgs

The mouse-down event data.

Returns:

bool

false so the control continues its standard event processing.

Marks the root element as under the pointer when mouse-event processing is enabled.

C#
public virtual bool OnMouseEnter(EventArgs e)
Parameters:eEventArgs

The mouse-enter event data.

Returns:

bool

false so the control continues its standard event processing.

Forwards the hover notification to the captured item when mouse-event processing is enabled.

C#
public virtual bool OnMouseHover(EventArgs e)
Parameters:eEventArgs

The mouse-hover event data.

Returns:

bool

false so the control continues its standard event processing.

Stops hover monitoring and clears the selected element's hover state when mouse-event processing is enabled.

C#
public virtual bool OnMouseLeave(EventArgs e)
Parameters:eEventArgs

The mouse-leave event data.

Returns:

bool

false so the control continues its standard event processing.

Updates the hovered element or routes movement to the captured item, including enter/leave transitions while captured.

C#
public virtual bool OnMouseMove(MouseEventArgs e)
Parameters:eMouseEventArgs

The mouse-move event data.

Returns:

bool

false so the control continues its standard event processing.

Routes mouse-up to the captured item, selected element, or hit-tested element when mouse input is enabled.

C#
public virtual bool OnMouseUp(MouseEventArgs e)
Parameters:eMouseEventArgs

The mouse-up event data.

Returns:

bool

false so the control continues its standard event processing.

Routes the wheel event to the focused element, or to the selected element when none is focused.

C#
public virtual bool OnMouseWheel(MouseEventArgs e)
Parameters:eMouseEventArgs

The mouse-wheel event data.

Returns:

bool

false so the control continues its standard event processing.

Events

Fires when hovered element is changed.

C#
public event HoveredElementChangedEventHandler HoveredElementChanged