Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
emphyrio61  
#1 Posted : Friday, April 26, 2019 3:36:40 PM(UTC)
emphyrio61

Rank: Newbie

Groups: Registered
Joined: 4/26/2019(UTC)
Posts: 3
Location: Krommenie

Hello,

I'm trying to change the cursor to the hand symbol on the header of the iGrid active-X control in an MS-Access 2010 database.
It works fine for the grid itself using the MouseMove event of the control. But not for the headers. How can I change the mouse cursor when hovering over the header?
Hope there is a solution?

My Code:

Private Const IDC_HAND = 32649&
Private Declare Function LoadCursorLong Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long

Private Function SetMouseCursor(CursorType As Long)
Dim hCursor As Long
hCursor = LoadCursorLong(0&, CursorType)
hCursor = SetCursor(hCursor)
End Function

Private Sub IG_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single, ByVal lRow As Long, ByVal lCol As Long)
If IG.CellIcon(lRow, lCol) > 0 Then SetMouseCursor IDC_HAND
End Sub

This shows the hand symbol whenever there is an icon in the cell.
How to do it for the header?

Best regards,
Emphyrio

Edited by user Friday, April 26, 2019 3:39:30 PM(UTC)  | Reason: Not specified

Igor/10Tec  
#2 Posted : Monday, April 29, 2019 8:09:00 AM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,053

Thanks: 14 times
Was thanked: 137 time(s) in 137 post(s)
iGrid's header is an instance of the Microsoft Header Control provided by the OS. It's another control inside the whole iGrid control. You can try to duplicate your code that changes the cursor for the header control in an event handler of the ColHeaderMouseEnter event. However, the Microsoft Header Control may override your settings as it has its own processing of mouse events.
emphyrio61  
#3 Posted : Monday, April 29, 2019 10:29:26 AM(UTC)
emphyrio61

Rank: Newbie

Groups: Registered
Joined: 4/26/2019(UTC)
Posts: 3
Location: Krommenie

Yes, I did try the ColHeaderMouseEnter event, but it did not work.
Would you know any API calls that might do the trick?
Igor/10Tec  
#4 Posted : Tuesday, April 30, 2019 7:06:58 AM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,053

Thanks: 14 times
Was thanked: 137 time(s) in 137 post(s)
No. At the moment, I can't suggest a solution. As I wrote, the Microsoft Header Control has its own logic, and I doubt we can find a robust solution to set our cursor in all possible scenarios.

Can you tell us, why do you want to change the cursor for the whole grid? It would be nice to see an accompanying screenshot.
emphyrio61  
#5 Posted : Tuesday, April 30, 2019 11:23:19 AM(UTC)
emphyrio61

Rank: Newbie

Groups: Registered
Joined: 4/26/2019(UTC)
Posts: 3
Location: Krommenie

Hi, The reason is that in my whole application all user actions are indicated by the hand cursor, like on a website. I have icons in the header for specific actions like exporting to Excel. To give my user a sense of continuity, I would like to change the cursor so they know an action is available when hovering over the header. See attachment: eStar.png
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.