MouseDevice.DirectlyOver Property

Definition

Gets the element that the mouse pointer is directly over.

public:
 property System::Windows::IInputElement ^ DirectlyOver { System::Windows::IInputElement ^ get(); };
public System.Windows.IInputElement DirectlyOver { get; }
member this.DirectlyOver : System.Windows.IInputElement
Public ReadOnly Property DirectlyOver As IInputElement

Property Value

The element the mouse pointer is over.

Remarks

The mouse is considered directly over an element if the mouse has been captured to that element.

Controls can be composed of multiple elements. DirectlyOver reports the specific element in the composite control the mouse pointer is over and not the control itself. For example, depending on which part of a Button the pointer is over, the DirectlyOver property could report the TextBox of the Content property or the ButtonChrome.

Use the IsMouseOver property on UIElement and ContentElement to determine whether the mouse is over an element, which includes its visual child elements or control compositing elements.

Applies to