Mouse Class

Note: This class is new in the .NET Framework version 2.0.

Provides properties for getting information about the format and configuration of the mouse installed on the local computer.

Namespace: Microsoft.VisualBasic.Devices
Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)

public class Mouse
public class Mouse
public class Mouse

For more detailed information, see the Visual Basic topic My.Computer.Mouse Object.

The My.Computer.Mouse object provides a way to find information about the computer's mouse: whether the mouse buttons are swapped, and details about the mouse wheel.

This example uses the My.Computer.Mouse.WheelExists and My.Computer.Mouse.WheelScrollLines properties to determine if the mouse has a scroll wheel and how much to scroll when it rotates.

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.")
        MsgBox("Application scrolls " & _
            (-lines) & " page(s) for each wheel turn.")
    End If
    MsgBox("Mouse has no scroll wheel.")
End If


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0