Hide the cursor

If, for some reason, you want to hide the mouse cursor (and I can't imagine why!), you can simply call the ShowCursor API call. To hide the cursor, call pHideCursor. To show the cursor, call pShowCursor. Don't forget to call pShowCursor when your program ends!

Option Explicit
Private Declare Function ShowCursor Lib "user32" (ByVal lShow As Long) As Long

Public Sub pHideCursor()
    ShowCursor False
End Sub

Public Sub pShowCursor()
    ShowCursor True
End Sub

You might also like...

Comments

James Crowley James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audience ...

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan