次の方法で共有


Mouse.WheelExists プロパティ

定義

マウスにスクロール ホイールがあるかどうかを示す Boolean を取得します。

public:
 property bool WheelExists { bool get(); };
public bool WheelExists { get; }
member this.WheelExists : bool
Public ReadOnly Property WheelExists As Boolean

プロパティ値

マウスにスクロール ホイールがある場合 True 値を持つブール値。それ以外の場合は False

例外

コンピューターにマウスがインストールされていません。

次の使用例は、 My.Computer.Mouse.WheelExists プロパティを使用して、マウスにスクロール ホイールがあるかどうか、およびマウス ホイールが回転したときにスクロールする量を決定します。

If My.Computer.Mouse.WheelExists Then
    Dim lines As Integer = My.Computer.Mouse.WheelScrollLines
    If lines > 0 Then
        MsgBox("Application scrolls " &
            lines & " line(s) for each wheel turn.")
    Else
        MsgBox("Application scrolls " &
            (-lines) & " page(s) for each wheel turn.")
    End If
Else
    MsgBox("Mouse has no scroll wheel.")
End If

注釈

My.Computer.Mouse.WheelExists プロパティは、MouseWheelPresent プロパティと同様の機能を提供します。

WheelScrollLines プロパティにアクセスする前に、My.Computer.Mouse.WheelExists プロパティの値を確認する必要があります。マウスにスクロール ホイールがない場合は例外がスローされます。

My.Computer.Mouse.WheelExists プロパティは、コードを実行するコンピューターに関する情報を提供します。

プロジェクトの種類別の可用性

プロジェクトの種類 在庫有り
Windows アプリケーション はい
クラス ライブラリ はい
コンソール アプリケーション はい
Windows コントロール ライブラリ はい
Web コントロール ライブラリ いいえ
Windows サービス はい
ウェブサイト いいえ

適用対象

こちらもご覧ください