Mouse.RightButton 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
要找到正確的按鈕狀態。
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