Hi! can anyone help me?
I want to make my cursor-image to a hand, or something... i can get the pic, but I need some help with the programming!
Plz make it as simpel as it can be, im quite new to this! Im using vb.net
Thanx alot!
Printable View
Hi! can anyone help me?
I want to make my cursor-image to a hand, or something... i can get the pic, but I need some help with the programming!
Plz make it as simpel as it can be, im quite new to this! Im using vb.net
Thanx alot!
This will set the cursor to be a hand:
VB.Net Code:
Cursor.Current = Cursors.Hand
yea... but I wanna draw the hand my self! In other words... make a pic as cursor... can u or somebody else help me?
So, are you asking how to draw the hand, or how to use the image of a hand you have already drawn?
I have drawn a hand allredy! I need it to be a the cursor in my game!
U know a drag and drop game!
Can u help me with the programming plz? =D
thanx
Just give it the Handle of an existing icon (this would use the icon on a form).vb Code:
Cursor.Current = New Cursor(Me.Icon.Handle)
http://www.mredkj.com/vbnet/CustomDragIcon.html
Well in that case, try this:
vb Code:
Cursor.Current = New System.Windows.Forms.Cursor("location of cursor file")
Draw your cursor and pass the graphics object to this method.
Me.Cursor.Draw(g, rectangle)
TryCode:Cursor.Current = New Cursor("your_picture.cur")
Im going to test this soon... I just need a minute before I can do it!
but thanx so far!
Which do you have? A file of it, resource file of it, or drawing it in memory?
I have drawn it in photoshop so I guess I have a file of it! i think
Yes. You can use post #6 or #7's code to do it then. If you add it as a resource file it would be better then an external file on your file system.
I dont think a normal picture file does it, it needs to be a valid icon or cursor file.
Yes, but if you add it to a ImageList you can get a handle to it for use with code like #6.
I think something like this will work for pulling an image from an imagelist for use as an cursor.
Code:Cursor.Current = New Cursor(System.Drawing.Icon.FromHandle(CType(Me.ImageList1.Images(1), System.Drawing.Bitmap).GetHicon()))
It dont want to be in colour! WHY?
What format is the file?
What method are you using? RobDogs?
It may be best to convert it into an ICO file before using it in your application. There could be an issue with the nasty casting RobDog is doing :)
I suspect that if he's using the ImageList way, he needs to set the ColorDepth property to something appropriate.
Its not nasty :D :p
If the imagelist is not setup for the proper color depth then it will loose color.