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
要求
命名空间:Microsoft.VisualBasic.Devices
类:Mouse
**程序集:**Visual Basic 运行库(位于 Microsoft.VisualBasic.dll 中)
按项目类型列出的可用性
项目类型 |
可用 |
---|---|
Windows 应用程序 |
是 |
类库 |
是 |
控制台应用程序 |
是 |
Windows 控件库 |
是 |
Web 控件库 |
否 |
Windows 服务 |
是 |
网站 |
否 |