My.Computer.Mouse 物件
更新:2007 年 11 月
提供屬性,用於取得已安裝在本機電腦上之滑鼠的格式和組態相關資訊。
備註
My.Computer.Mouse 物件會提供一種尋找電腦滑鼠相關資訊的方法:是否已交換滑鼠按鈕,以及滑鼠滾輪的詳細資料。
範例
這個範例會使用 My.Computer.Mouse.WheelExists 和 My.Computer.Mouse.WheelScrollLines 屬性,判斷滑鼠是否有滾輪以及在旋轉時會捲動多少。
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
需求
命名空間 (Namespace)︰Microsoft.VisualBasic.Devices
類別︰Mouse
組件:Visual Basic 執行階段程式庫 (在 Microsoft.VisualBasic.dll 中)
依專案類型的可用性
專案類型 |
是否可用 |
---|---|
Windows 應用程式 |
是 |
類別庫 |
是 |
主控台應用程式 |
是 |
Windows 控制項程式庫 |
是 |
Web 控制項程式庫 |
否 |
Windows 服務 |
是 |
網站 |
否 |