Results 1 to 7 of 7

Thread: mouse cursor icons

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281
    Hello everybody

    My mouse cursor turns to a hand over my form. I was just wondering if it was possible to change the mouse cursor again - to another hand, a clenched fist - when the mouse button is pressed over my form.

    How would I do this?

    It would just be a nice touch like I've seen in other programs - the hand sort of closes its fingers and drags the form around the screen.

    Thanks for any help!

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Use the Form's Mouse Down event.

    Cheers,

    Paul

    P.S. Do not forget to use MouseUp to change it back again...
    Not nearly so tired now...

    Haven't been around much so be gentle...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281
    Thanks,

    I had an idea it would be like that but...what am I doing wrong?


    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Form1.mouseIcon = "c:\windows\desktop\H_move.cur"

    End Sub

    I get a 'type mismatch' error

    Thanks.

  4. #4
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Errr... Dunno, have you tried MousePointer?

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Mouseicon is a stdpicture, not a string, therefore you get the type mismatch, well i think you just forgot to use loadpicture
    Form1.mouseIcon = Loadpicture("c:\windows\desktop\H_move.cur")

    Set mousepointer to 99, and the icon shows up.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281
    This works:

    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Form1.MouseIcon = LoadPicture("c:\windows\desktop\H_move.cur")
    End Sub

    Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Form1.MouseIcon = LoadPicture("c:\windows\desktop\H_arrow.cur")
    End Sub

    But the above means that the user has to have those cursors on their desktop. Is there anyway to include them in my exe or something?

  7. #7
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    place the cursor inside a control property, like picturebox or image. or use a imagelist and it will be compiled with the exe.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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