Mouse 类

定义

提供用于获取有关在本地计算机上安装鼠标的格式和配置的信息的属性。

public ref class Mouse
public class Mouse
type Mouse = class
Public Class Mouse
继承
Mouse

示例

此示例使用 My.Computer.Mouse.WheelExistsMy.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 应用程序 Yes
类库 Yes
控制台应用程序 Yes
Windows 控件库 Yes
Web 控件库
Windows 服务 Yes
网站

构造函数

名称 说明
Mouse()

初始化 Mouse 类的新实例。

属性

名称 说明
ButtonsSwapped

获取一个 Boolean 值,该值指示是否交换了左右鼠标按钮的功能。

WheelExists

获取一个 Boolean 指示鼠标是否具有滚轮。

WheelScrollLines

获取一个数字,该值指示在鼠标滚轮旋转一个圆圈时滚动多少。

方法

名称 说明
Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

适用于

另请参阅