共用方式為


Mouse.WheelScrollLines 屬性

定義

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

public:
 property int WheelScrollLines { int get(); };
public int WheelScrollLines { get; }
member this.WheelScrollLines : int
Public ReadOnly Property WheelScrollLines As Integer

屬性值

那是 Integer 當滑鼠滾輪旋轉一個檔位時,該滾動多少。 正值表示以該行數滾動,負值則表示一次只捲動一個螢幕。

例外狀況

滑鼠沒有滾輪。

範例

這個範例判斷滑鼠是否有滾輪,並利用該 My.Computer.Mouse.WheelExists 屬性決定滾輪旋轉時要滾動多少。

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.WheelScrollLines 屬性提供與該 MouseWheelScrollLines 屬性類似的功能。

因為這個屬性如果滑鼠沒有滾輪會拋出例外,你應該透過檢查 My.Computer.Mouse.WheelExists 該屬性來確認滑鼠有滾輪。

此特性提供關於執行程式碼的電腦資訊。

依專案類型提供的可用性

專案類型 有現貨
Windows 應用程式 是的
類別庫 是的
主控台應用程式 是的
Windows 控制函式庫 是的
網頁控制函式庫 No
Windows 服務 是的
網站 No

適用於

另請參閱