This documentation is archived and is not being maintained.

Mouse.DirectlyOver Property

Gets the element the mouse pointer is directly over.

Namespace: System.Windows.Input
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:

public static IInputElement DirectlyOver { get; }
/** @property */
public static IInputElement get_DirectlyOver ()

public static function get DirectlyOver () : IInputElement

You cannot use this property in XAML.

Property Value

The element the mouse pointer is over.

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.

If an element has mouse capture, the mouse pointer is considered directly over the element regardless of the where the mouse pointer is.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0