MouseRightButtonDown (UIElement)

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

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)

Arguments

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)

Managed Equivalent

MouseRightButtonDown

Remarks

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.

Version Information

Silverlight 4

Applies To

Border (Silverlight 2)

Canvas

Ellipse

Glyphs

Image

InkPresenter

Line

MediaElement

PasswordBox (Silverlight 2)

Path

Polygon

Polyline

Popup (Silverlight 2)

Rectangle

StackPanel (Silverlight 2)

TextBlock

TextBox (Silverlight 2)