Groups | Blog | Home
all groups > dotnet windows forms > june 2007 >

dotnet windows forms : ?? Setting Hotspot on Custom Cursor ??


A. Foxmore
6/14/2007 6:59:00 AM
This is driving me nuts -- I create a cursor at runtime from an Image. The
problem is that the Hotspot is always the center of the resulting cursor.
There is a Hotspot property on the Cursor class but it's read only.

Is there anyway to set the Hotspot of a dynamically created cursor?

A. Foxmore
6/14/2007 8:45:01 AM
Well, I think I *do* have a cursor, not an icon. I am calling the Cursor's
c'tor. What's more, since when do icons have hotspots?

I appreciate the response but I was looking for less of a hack.



[quoted text, click to view]
Richard Lewis Haggard
6/14/2007 11:29:46 AM
The basic problem is that you do not actually have a cursor. You have an
icon. The hotspot of an icon is always in the middle and you can't do
anything about that. The solution is a hack that I am particularly proud
of - make your icon big enough so that its middle hotspot resides where
you'd like to have the custom cursor's be.

For example, assume that you want to make a custom cursor from a standard
arrow. Define your actual custom icon to be big enough so that the arrow's
hot spot is in the middle of the icon. When the custom cursor draws, the
user will only see your arrow and the remaining 3/4's is all blank.
--
Richard Lewis Haggard
General: www.Haggard-And-Associates.com
Please come visit here for a couple thousand good giggles!:
www.haggard-and-associates.com/Humor/humor.htm


[quoted text, click to view]

AddThis Social Bookmark Button