AdvancedHMI Software

General Category => Open Discussion => Topic started by: Darrell on March 06, 2017, 01:15:31 AM

Title: mouse pointer change
Post by: Darrell on March 06, 2017, 01:15:31 AM
Is there a way to get the mouse pointer to change, lets say to a hand , when it is hovered over something that can be clicked
Title: Re: mouse pointer change
Post by: Archie on March 06, 2017, 03:53:53 AM
Here is one way of doing it for a button:
Code: [Select]
    Private Sub Button1_MouseEnter(sender As Object, e As EventArgs) Handles Button1.MouseEnter
        Cursor = Cursors.Hand
    End Sub

    Private Sub Button1_MouseLeave(sender As Object, e As EventArgs) Handles Button1.MouseLeave
        Cursor = Cursors.Arrow
    End Sub

You add additional controls to this same code by adding to the Handles list. For example:

    Private Sub Button1_MouseEnter(sender As Object, e As EventArgs) Handles Button1.MouseEnter, Button2.MouseEnter, Button2.MouseEnter