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 物件提供了一種方式來查找電腦滑鼠的資訊:滑鼠按鍵是否被交換,以及滑鼠滾輪的詳細資訊。

依專案類型提供可用性

專案類型 Available
Windows 應用程式 Yes
類別庫 Yes
主控台應用程式 Yes
Windows 控件庫 Yes
Web 控制庫 No
Windows 服務 Yes
網站 No

建構函式

名稱 Description
Mouse()

初始化 Mouse 類別的新執行個體。

屬性

名稱 Description
ButtonsSwapped

會顯示 Boolean 左右滑鼠按鈕的功能是否被調換。

WheelExists

會顯示 Boolean 滑鼠是否有滾輪。

WheelScrollLines

當滑鼠滾輪旋轉一個檔位時,會顯示滾動的數字。

方法

名稱 Description
Equals(Object)

判斷指定的 物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前實例的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ToString()

傳回表示目前 物件的字串。

(繼承來源 Object)

適用於

另請參閱