Results 1 to 7 of 7

Thread: Changing the mouse pointer

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455

    Changing the mouse pointer

    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.

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    Me.Cursor = Cursors. - choose your cursor shape

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455
    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

  4. #4
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    313
    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.

  5. #5
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Try this
    VB Code:
    1. Me.Cursor = Cursors.Busy

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455
    Thanks all for the information.

    Michelle.

  7. #7
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    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:
    1. Try
    2.     Cursor.Current = Cursors.WaitCursor
    3.     TreeView1.BeginUpdate()
    4.  
    5. 'Write code here to add items to treeview.
    6.  
    7. Catch ex As Exception
    8.     Debug.WriteLine(ex.Message)
    9. Finally
    10.     TreeView1.EndUpdate()
    11.     Cursor.Current = Cursors.Default
    12. End Try
    This world is not my home. I'm just passing through.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width