Mouse 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供用于获取有关在本地计算机上安装鼠标的格式和配置的信息的属性。
public ref class Mouse
public class Mouse
type Mouse = class
Public 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 应用程序 | Yes |
| 类库 | Yes |
| 控制台应用程序 | Yes |
| Windows 控件库 | Yes |
| Web 控件库 | 否 |
| Windows 服务 | Yes |
| 网站 | 否 |
构造函数
| 名称 | 说明 |
|---|---|
| Mouse() |
初始化 Mouse 类的新实例。 |
属性
| 名称 | 说明 |
|---|---|
| ButtonsSwapped |
获取一个 |
| WheelExists |
获取一个 |
| WheelScrollLines |
获取一个数字,该值指示在鼠标滚轮旋转一个圆圈时滚动多少。 |
方法
| 名称 | 说明 |
|---|---|
| Equals(Object) |
确定指定的对象是否等于当前对象。 (继承自 Object) |
| GetHashCode() |
用作默认哈希函数。 (继承自 Object) |
| GetType() |
获取当前实例的 Type。 (继承自 Object) |
| MemberwiseClone() |
创建当前 Object的浅表副本。 (继承自 Object) |
| ToString() |
返回一个表示当前对象的字符串。 (继承自 Object) |