Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

UIElement.PreviewMouseLeftButtonDown Event

Occurs when the left mouse button is pressed while the mouse pointer is over this element.

Namespace: System.Windows
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public event MouseButtonEventHandler PreviewMouseLeftButtonDown
/** @event */
public final void add_PreviewMouseLeftButtonDown (MouseButtonEventHandler value)

/** @event */
public final void remove_PreviewMouseLeftButtonDown (MouseButtonEventHandler value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
<object PreviewMouseLeftButtonDown="MouseButtonEventHandler" .../>

Identifier field

PreviewMouseLeftButtonDownEvent

Routing strategy

Direct

Delegate

MouseButtonEventHandler

Although this routed event seems to follow a tunneling route through an element tree, it actually is a direct routed event that is raised and reraised along the element tree by each UIElement.

This event is one of several related events that report the mouse-button specifics of an underlying Mouse.PreviewMouseDown event, which is an attached event that is processed by each element along an event route.

The event data of this event exposes the event data of the underlying Mouse.PreviewMouseDown event. If that event is marked as handled along the event route, the mouse-button specific events are still raised; however, handlers of the mouse-button specific events must be added by explicitly calling AddHandler, with the option to handle events that are already marked as handled, in order to be listeners to the event. If you mark PreviewMouseLeftButtonDown handled, you are essentially marking Mouse.PreviewMouseDown handled for all further listeners along the route, and on all related events. This possibly includes class-handler generated events such as PreviewMouseDoubleClick.

Conceptually, think of this event (and other mouse-button events on UIElement) to be a mouse "service" (with the service definition provided by the Mouse class). The event adds the convenience of not needing to check the mouse button states (left-right, up-down) of the original mouse events in the event data. For more advanced scenarios, such as checking for states of non-standard buttons, you might need to use the APIs on the Mouse class rather than those on UIElement.

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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft