Mouse 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供用于获取本地计算机中所安装鼠标的型号和配置信息的属性。
public ref class Mousepublic class Mousetype Mouse = classPublic Class Mouse- 继承
- 
				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
注解
对象 My.Computer.Mouse 提供了一种查找有关计算机鼠标的信息的方法:是否交换了鼠标按钮,以及有关鼠标滚轮的详细信息。
可用性(按项目类型)
| 项目类型 | 可用 | 
|---|---|
| Windows 应用程序 | 是 | 
| 类库 | 是 | 
| 控制台应用程序 | 是 | 
| Windows 控件库 | 是 | 
| Web 控件库 | 否 | 
| Windows 服务 | 是 | 
| 网站 | 否 | 
构造函数
| Mouse() | 初始化 Mouse 类的新实例。 | 
属性
| ButtonsSwapped | 获取一个  | 
| WheelExists | 获取一个  | 
| WheelScrollLines | 鼠标滚轮旋转一个单位时的滚动量。 | 
方法
| Equals(Object) | 确定指定对象是否等于当前对象。(继承自 Object) | 
| GetHashCode() | 作为默认哈希函数。(继承自 Object) | 
| GetType() | 获取当前实例的 Type。(继承自 Object) | 
| MemberwiseClone() | 创建当前 Object 的浅表副本。(继承自 Object) | 
| ToString() | 返回表示当前对象的字符串。(继承自 Object) |