Udostępnij za pośrednictwem


MouseEventArgs

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Provides data for mouse-related events.

Syntax Notes

MouseEventArgs is obtained as input for your own MouseEnter, MouseLeave, MouseLeftButtonDown, MouseLeftButtonUp, and KeyUp event handlers.

Derived Objects

MouseButtonEventArgs

Managed Equivalent

MouseEventArgs or MouseButtonEventArgs

Remarks

MouseEventArgs is used with the following events: MouseEnter, MouseLeave, MouseLeftButtonDown, MouseLeftButtonUp, and KeyUp.

In addition to properties, MouseEventArgs also has several specialized methods, including GetPosition. You can obtain the coordinates where a mouse event occurred by calling the GetPosition method on the MouseEventArgs object, rather than by getting a value for "X" or "Y" properties of MouseEventArgs. This is because GetPosition provides the ability to get a coordinate offset from a specified object, which can be useful for clarifying the coordinate reference frame for a particular sender of the event.

For more information on basic concepts, see Mouse Support. Note that the Mouse Support topic is written primarily for users of the managed API, and may not have code examples or specific information that address the JavaScript API scenarios.

See Also

Reference