Hello VB.net users,
I tried to change the mouse pointer in vb.net. Can someone show me a source how to do this.
Nice regards,
Michelle.
Printable View
Hello VB.net users,
I tried to change the mouse pointer in vb.net. Can someone show me a source how to do this.
Nice regards,
Michelle.
Me.Cursor = Cursors. - choose your cursor shape
What do I wrong??
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Cursor = 1
End Sub
End Class
Cursor 1 will not work, it will not compile if you just put a one there. Try putting the name like default or ibeam. also do you have anything like a text box that could change the cursor, I think you may have to change it's cursor proporties also.
Try this
VB Code:
Me.Cursor = Cursors.Busy
Thanks all for the information.
Michelle.
Just in case anybody doesn't already know this...
If you change the cursor you should always use a Try-Catch-Finally structure so that if something goes wrong the cursor isn't left looking like an hour-glass for evermore.
VB Code:
Try Cursor.Current = Cursors.WaitCursor TreeView1.BeginUpdate() 'Write code here to add items to treeview. Catch ex As Exception Debug.WriteLine(ex.Message) Finally TreeView1.EndUpdate() Cursor.Current = Cursors.Default End Try