Export (0) Print
Expand All

MouseRightButtonDown (UIElement)

Silverlight

Occurs when the right mouse button is pressed while the mouse is over the object (or the mouse is captured).

<object MouseRightButtonDown="eventhandlerFunction".../>
[token = ]object.AddEventListener("MouseRightButtonDown", eventhandlerFunction)

AddEventListener Parameters

token

integer

A token that is returned from the function, which you can optionally retain as a variable. If you intend to call RemoveEventListener to remove the handler, you will need this token.

eventhandlerFunction

object

The name of your event handler function as it is defined in script. When used as an AddEventListener parameter, quotation marks around the function name are not required. (See the "Remarks" section.)

Event Handler Parameters

sender

object

The object that invoked the event.

mouseButtonEventArgs

object

MouseButtonEventArgs

mouseButtonEventArgs.GetPosition(element).X identifies the x-coordinate position of the mouse.

mouseButtonEventArgs.GetPosition(element).Y identifies the y-coordinate position of the mouse.

mouseButtonEventArgs.Shift determines whether the SHIFT key is down.

mouseButtonEventArgs.Ctrl determines whether the CTRL key is down.

mouseButtonEventArgs.Handled: A Boolean value that determines whether event routing should continue. (Silverlight 2)

mouseButtonEventArgs.Source: Reports the object that raised the event. (Silverlight 2)

In order to receive right-click events, you must set the value of Handled to true in your handler. Otherwise, right-click events are handled by the client, which displays the Silverlight configuration dialog box, and your handler is not invoked.

Silverlight 4

Community Additions

ADD
Show:
© 2014 Microsoft