VB.NET - Tip

VB.NET Hide Cursor

Synopsis:

In vb 6 to hide the mouse cursor you needed to make an api call. VB.net makes things much simpler with the use of the cursor object. Listed below is the code behind two buttons one which makes the cursor invisible and the other which shows it again.

The Code:

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
	 	Handles Button1.Click
        
	Cursor.Hide()
    End Sub


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
		Handles Button2.Click
        
	Cursor.Show()
    End Sub
About this page: