ContentElement.MouseRightButtonDown ContentElement.MouseRightButtonDown ContentElement.MouseRightButtonDown ContentElement.MouseRightButtonDown Event


滑鼠指標在此元素上方且按下滑鼠右按鈕時發生。Occurs when the right mouse button is pressed while the mouse pointer is over this element.

 virtual event System::Windows::Input::MouseButtonEventHandler ^ MouseRightButtonDown;
public event System.Windows.Input.MouseButtonEventHandler MouseRightButtonDown;
member this.MouseRightButtonDown : System.Windows.Input.MouseButtonEventHandler 
Public Custom Event MouseRightButtonDown As MouseButtonEventHandler 



雖然此路由事件總覽看起來會遵循專案樹狀結構中的反升路由, 但實際上是直接路由事件, 會沿著元素樹狀結構ContentElement逐一引發和 reraised。Although this Routed Events Overview seems to follow a bubbling route through an element tree, it actually is a direct routed event that is raised and reraised along the element tree by each ContentElement.

這個事件是數個相關事件的其中一個, 可報告基礎Mouse.MouseDown事件的滑鼠按鍵細節, 這是一種附加事件, 會沿著事件路由中的每個元素來處理。This event is one of several related events that report the mouse-button specifics of an underlying Mouse.MouseDown event, which is an attached event that is processed by each element along an event route.

這個事件的引數會公開基礎Mouse.MouseDown事件的引數。The arguments of this event expose the arguments of the underlying Mouse.MouseDown event. 如果該事件標示為沿著事件路由處理, 則仍然會引發滑鼠按鍵特定事件;不過, 必須透過明確呼叫AddHandler來加入滑鼠按鍵特定事件的處理常式, 並使用選項來處理已標示為已處理的事件, 以便成為事件的接聽項。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.

在概念上, 請將這個事件 (和上ContentElement的其他滑鼠按鍵事件) 視為滑鼠「服務」 (具有Mouse類別所提供的服務定義)。Conceptually, think of this event (and other mouse-button events on ContentElement) 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. 針對更先進的案例, 例如檢查非標準按鈕的狀態, 您可能需要APIAPIs Mouse在類別上使用, 而不是在上ContentElement使用。For more advanced scenarios, such as checking for states of non-standard buttons, you might need to use the APIAPIs on the Mouse class rather than those on ContentElement.

右鍵按鈕: 滑鼠事件在應用程式案例中經常會有原生處理。Right button mouse events frequently have native handling in application scenarios. 比方說, 滑鼠右鍵向下鍵可能會顯示內容功能表。For instance, a right mouse button down might display a context menu. 請參閱CoNtextMenu 總覽See ContextMenu Overview.

路由事件資訊Routed Event Information

識別碼欄位Identifier field MouseRightButtonDownEvent
路由策略Routing strategy 直接Direct
Delegate - 委派Delegate MouseButtonEventHandler