Results 1 to 10 of 10

Thread: Change Mouse Cursor

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Question Change Mouse Cursor

    Hello,
    I want to change the mouse cursor like Hand Cursor (Normally we see this cursor in Web Link) when mouse moves on a label and change back to default when move to form.

    Please help me
    Farooq

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Change Mouse Cursor

    This example changes the color of a button, but should be good enough to be able to subtstitue what you want.
    Attached Files Attached Files

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Change Mouse Cursor

    Thanks,
    I dont want to change the color of button, i want to change the mouse Cursor

  4. #4
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Change Mouse Cursor

    Quote Originally Posted by hafizfarooq
    Thanks,
    I dont want to change the color of button, i want to change the mouse Cursor
    First set the label's MousePointer to 99 (custom). And then assingn the the MouseIcon property a cursor/icon file (which can be a 'Hand' as u want).

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Change Mouse Cursor

    Thanks
    Please give me some to to do the above ?

  6. #6
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Change Mouse Cursor



    Has someone helped you? Then you can Rate their helpful post.

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Change Mouse Cursor

    Quote Originally Posted by hafizfarooq
    Thanks,
    I dont want to change the color of button, i want to change the mouse Cursor
    You said you wanted a different cursor when the mouse was over a label. The method is the same for coloring a button, except for one statemnt to color and another to uncolor. You need the same thing with a change to where it colors the control, to changing the cursor.

    Also, put the code from the buttone into coding for the label.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Resolved Re: Change Mouse Cursor

    Thanks,
    Problem RESOLVED with the follwoing code

    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.MousePointer = 0
    End Sub

    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.MousePointer = 99
    Me.MouseIcon = LoadPicture("C:\Harrow.Cur")
    End Sub


    Thanks to all

  9. #9
    Banned ThaRubby's Avatar
    Join Date
    Apr 2005
    Location
    127.0.0.1
    Posts
    356

    Re: Change Mouse Cursor

    Thanks
    Please give me some to to do the above ?
    Even know its resolved, doing a search for ".cur" will turn up hundreds. Good luck.

    *EDIT* I meant search within your computer not google btw
    Last edited by ThaRubby; Jun 12th, 2005 at 06:17 PM.

  10. #10
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Change Mouse Cursor

    You don't need that code to set the hand cursor for a label. The Label itself also have the MousePointer and MouseIcon properties which you can set at design time.

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