Mouse.RightButton 屬性

定義

取得右鍵的狀態。

public:
 static property System::Windows::Input::MouseButtonState RightButton { System::Windows::Input::MouseButtonState get(); };
public static System.Windows.Input.MouseButtonState RightButton { get; }
static member RightButton : System.Windows.Input.MouseButtonState
Public Shared ReadOnly Property RightButton As MouseButtonState

屬性值

滑鼠右鍵的狀態。

範例

下列範例示範如何藉由檢查 的狀態 RightButton 是否等於 MouseButtonState 列舉值 Pressed,判斷是否按下滑鼠右鍵。 如果按下按鈕,則會呼叫方法,以更新範例中的顯示元素。

if (Mouse.RightButton == MouseButtonState.Pressed)
{
    UpdateSampleResults("Right Button Pressed");
}
If Mouse.RightButton = MouseButtonState.Pressed Then
    UpdateSampleResults("Right Button Pressed")
End If

適用於

另請參閱