470,566 Members | 1,378 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,566 developers. It's quick & easy.

changing mouse cursor over certain DataGrid columns

How can I customize DataGrid so that when the mouse hovers over certain
columns the cursor changes to the Cursors.Hand cusror? I was unable to use
the MouseEnter/MouseLeave events on DataGrid itself because those events do
not use the MouseEventArgs, so I can't get the X Y position to determine if
the cursor should change for that column
Nov 16 '05 #1
1 2619
MrNobody,

Use the MouseMove event handler. This will give you the X and Y
coordinates of the mouse in relation to the grid.. Once you have those, you
can call HitTest to determine which cell it is over. With that information,
you can set the cursor.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:95**********************************@microsof t.com...
How can I customize DataGrid so that when the mouse hovers over certain
columns the cursor changes to the Cursors.Hand cusror? I was unable to use
the MouseEnter/MouseLeave events on DataGrid itself because those events
do
not use the MouseEventArgs, so I can't get the X Y position to determine
if
the cursor should change for that column

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Geoff Soper | last post: by
3 posts views Thread by Tim | last post: by
1 post views Thread by John Paul. A (MCP ID# 3015176) | last post: by
15 posts views Thread by Dave | last post: by
3 posts views Thread by Steve Long | last post: by
2 posts views Thread by Jim Frazer | last post: by
2 posts views Thread by Dom | last post: by
1 post views Thread by livre | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.