Mouse.WheelExists 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得 Boolean,指出滑鼠是否具有滾輪。
public:
property bool WheelExists { bool get(); };
public bool WheelExists { get; }
member this.WheelExists : bool
Public ReadOnly Property WheelExists As Boolean
屬性值
如果滑鼠具有滾輪,則 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 屬性類似的功能。
您應該先檢查 屬性的值 My.Computer.Mouse.WheelExists ,再嘗試存取 WheelScrollLines 屬性,如果滑鼠沒有滾動滾輪,就會擲回例外狀況。
屬性 My.Computer.Mouse.WheelExists 提供執行程式碼之計算機的相關信息。
依專案類型的可用性
| 專案類型 | 可用 |
|---|---|
| Windows 應用程式 | 是 |
| 類別庫 | 是 |
| 主控台應用程式 | 是 |
| Windows 控制項程式庫 | 是 |
| Web 控制項程式庫 | 否 |
| Windows 服務 | 是 |
| 網站 | 否 |