Skip to Main Content
Programming WPF, 2nd Edition
book

Programming WPF, 2nd Edition

by Chris Sells, Ian Griffiths
August 2007
Intermediate to advanced content levelIntermediate to advanced
864 pages
25h 52m
English
O'Reilly Media, Inc.
Content preview from Programming WPF, 2nd Edition

Mouse Input

Mouse input is directed to whichever element is directly under the mouse cursor. All user interface elements derive from the UIElement base class, which defines a number of mouse input events. These are listed in Table 4-1.

Table 4-1. Mouse input events

Event

Routing

Meaning

GotMouseCapture

Bubble

Element captured the mouse.

LostMouseCapture

Bubble

Element lost mouse capture.

MouseEnter

Direct

Mouse pointer moved into element.

MouseLeave

Direct

Mouse pointer moved out of element.

PreviewMouseLeftButtonDown,

MouseLeftButtonDown

Tunnel, Bubble

Left mouse button pressed while pointer inside element.

PreviewMouseLeftButtonUp,

MouseLeftButtonUp

Tunnel, Bubble

Left mouse button released while pointer inside element.

PreviewMouseRightButtonDown,

MouseRightButtonDown

Tunnel, Bubble

Right mouse button pressed while pointer inside element.

PreviewMouseRightButtonUp,

MouseRightButtonUp

Tunnel, Bubble

Right mouse button released while pointer inside element.

PreviewMouseDown,

MouseDown

Tunnel, Bubble

Mouse button pressed while pointer inside element (raised for any mouse button).

PreviewMouseUp,

MouseUp

Tunnel, Bubble

Mouse button released while pointer inside element (raised for any mouse button).

PreviewMouseMove,

MouseMove

Tunnel, Bubble

Mouse pointer moved while pointer inside element.

PreviewMouseWheel,

MouseWheel

Tunnel, Bubble

Mouse wheel moved while pointer inside element.

QueryCursor

Bubble

Mouse cursor shape to be determined while pointer inside element.

In addition to the mouse-related events, UIElement ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming C#, 4th Edition

Programming C#, 4th Edition

Jesse Liberty
Programming C# 10

Programming C# 10

Ian Griffiths

Publisher Resources

ISBN: 9780596510374Supplemental ContentErrata Page