[Closed] Custom mouse icon?
c = dotnetclass "System.Windows.Forms.Cursor"
c.Current = dotnetobject "System.Windows.Forms.Cursor" "myCursor.ico"
but where and how do you want to show it? you can show this cursor just over dotnet controls
Yes, I have been able to do that with the .NET Framework.
From MSDN:
The mouse pointer is represented by the Cursor class, and each Control has a System.Windows.Forms.Control.Cursor property that specifies the pointer for that control. The Cursor class contains properties that describe the pointer, such as the Position and HotSpot properties, and methods that can modify the appearance of the pointer, such as the Show, Hide, and DrawStretched methods.
In the Cursor class, there is a static Current property that represents the current used cursor. You can create a custom mouse cursor by using the constructor Cursor(String) or Cursor(Stream).
So it won’t work on viewports and standard interface, right? Any solution for that? (SDK apart)
- Enrico
I’m looking to have it just over the tool that I’m developing. I’ll have a look at what you have there. Will it only use ico files?
Hum from what I remember using .net will change the cursor on any “surface”, but as soon as you move the mouse it returns to the “correct” cursor (maybe this only happens if the main thread is not busy however? not sure). On most .net controls you can set the cursor property to whatever cursor you want, which will remain even if you move the mouse, but of course only over that control.
As for the cursors themselves you can use “System.Windows.Forms.Cursors” along with “System.Windows.Forms.Cursor” (notice the S at the end, they are two different classes) to set the current cursor to one of the standard windows cursors. For instance:
cursors = dotNetClass "System.Windows.Forms.Cursors"
cursor = dotNetClass "System.Windows.Forms.Cursor"
cursor.current = cursors.WaitCursor
will set the cursor to the hourglass in XP and to the twirly circle in Vista.
Maybe this example, can be implemented in max?
http://www.ii.uni.wroc.pl/~wzychla/cs_enFAQ.html
-Johan
Thanks guys, I will be trying this in the next few days and I will post what I get working.
JHN, I think that can be adapted.
Hi Paul
try this
cursors = dotNetClass “System.Windows.Forms.Cursors”
hand_move = dotNetObject “System.Windows.Forms.Cursor” “C:\WINDOWS\Cursors\hmove.cur”
cursors.Hand.Current = hand_move
Thanks.
Here is a just a piece of the insanity that I have been working on.