Colored cursor

Stonkie

Well-known member
Joined
Sep 12, 2007
Messages
279
Programming Experience
1-3
Here's another pretty tough one! :eek:

I want to have a colored cursor in my application, but any cursor I do with colors shows in black and white. I searched some info on the web and I read there is a way to do it using API calls, but which ones and how?

I hope someone fluent in C++/Win32 can help me out on this! Thanks! :)
 
VB.NET:
Dim bmp As New Bitmap(16, 16)
Dim g As Graphics = Graphics.FromImage(bmp)
g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
g.FillEllipse(Brushes.Red, New Rectangle(0, 0, 15, 15))
g.Dispose()
Me.Cursor = New Cursor(bmp.GetHicon)
bmp.Dispose()
 
This piece of code is REALLY NICE. I didn't know about the GetIcon method of the bitmap object. Great ideas are always simple ones.
 
Great, thanks to both of you! It works perfectly.

JohnH, you're a .NET bible! ;)
 
Hey how does one make it so the cursor ANYWHERE is that new cursor, for instance if I set:
PHP:
Me.Cursor = System.Windows.Forms.Cursors.Hand
Then the cursor only becomes a hand when it is over the form. What can I do to have the cursor be different even when I move the cursor off the form?
 
Back
Top