Link to home
Start Free TrialLog in
Avatar of isnoend2001
isnoend2001Flag for United States of America

asked on

How to change the mouse icon in col in a mshflexgrid

I have a column of links that can be clicked and want the mouse pointer to turn to a finger
Private Sub FlxGrd_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
 If Index = 2 Then
   With FlxGrd(2)
    If .Row > 0 And .Col = 0 Then
      'change Mouse Icon here
      Else
      'default MouseIcon for other cols rows
    End If
  End With
 End If
End Sub
how to do this?
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've attached a bettor cursor for my example. You'll need to rename it to Hand.cur
HAND.txt
Avatar of isnoend2001

ASKER

Thanks that works
Didn't realize it at the time, but i have the cursor in a resource file
thanks martinliss
this works
Set .MouseIcon = LoadResPicture(101, vbResCursor), however it is not limited to the first column col(0)
Thanks vb_elmar
I am trying to tweak your code to work, so far no luck
if push comes to shove i will leave the finger and just get the data from first column based on the row clicked
however it is not limited to the first column col(0)
IIf you change line 5 in my code to

Set.MouseIcon = LoadResPicture(101, vbResCursor)

doesn't it work?
Yes it works good, Thank you
But  the whole grid is the finger, not just the first column(0)
Here is working code. (Substitute your resource cursor)

Private Sub FlxGrd_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)

If Index = 2 Then

    With FlxGrd(Index)
        If x < .CellWidth Then
        Set .MouseIcon = LoadPicture("C:\temp\hand.cur")
        .MousePointer = vbCustom
    Else
        .MousePointer = vbNormal
    End If
    
    End With

End If

End Sub

Open in new window

thanks martinliss

That works i could not get it to work so i had decided put it on the back burner until later
But now i don't have to
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written (some of them updated recently) that may interest you.
Marty - MVP 2009 to 2014