|
-
Jan 23rd, 2008, 12:28 PM
#1
Thread Starter
Member
Simpel cursor question
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!
-
Jan 23rd, 2008, 12:35 PM
#2
Re: Simpel cursor question
This will set the cursor to be a hand:
VB.Net Code:
Cursor.Current = Cursors.Hand
-
Jan 23rd, 2008, 01:21 PM
#3
Thread Starter
Member
Re: Simpel cursor question
yea... but I wanna draw the hand my self! In other words... make a pic as cursor... can u or somebody else help me?
-
Jan 23rd, 2008, 01:34 PM
#4
Re: Simpel cursor question
So, are you asking how to draw the hand, or how to use the image of a hand you have already drawn?
-
Jan 23rd, 2008, 01:38 PM
#5
Thread Starter
Member
Re: Simpel cursor question
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
-
Jan 23rd, 2008, 01:40 PM
#6
Re: Simpel cursor question
vb Code:
Cursor.Current = New Cursor(Me.Icon.Handle)
Just give it the Handle of an existing icon (this would use the icon on a form).
http://www.mredkj.com/vbnet/CustomDragIcon.html
-
Jan 23rd, 2008, 01:40 PM
#7
Re: Simpel cursor question
Well in that case, try this:
vb Code:
Cursor.Current = New System.Windows.Forms.Cursor("location of cursor file")
-
Jan 23rd, 2008, 01:42 PM
#8
Re: Simpel cursor question
Draw your cursor and pass the graphics object to this method.
Me.Cursor.Draw(g, rectangle)
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 23rd, 2008, 01:44 PM
#9
Re: Simpel cursor question
Try
Code:
Cursor.Current = New Cursor("your_picture.cur")
-
Jan 23rd, 2008, 01:52 PM
#10
Thread Starter
Member
Re: Simpel cursor question
Im going to test this soon... I just need a minute before I can do it!
but thanx so far!
-
Jan 23rd, 2008, 01:54 PM
#11
Re: Simpel cursor question
Which do you have? A file of it, resource file of it, or drawing it in memory?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 23rd, 2008, 02:21 PM
#12
Thread Starter
Member
Re: Simpel cursor question
I have drawn it in photoshop so I guess I have a file of it! i think
-
Jan 23rd, 2008, 02:26 PM
#13
Re: Simpel cursor question
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 23rd, 2008, 02:27 PM
#14
Re: Simpel cursor question
I dont think a normal picture file does it, it needs to be a valid icon or cursor file.
-
Jan 23rd, 2008, 02:29 PM
#15
Re: Simpel cursor question
Yes, but if you add it to a ImageList you can get a handle to it for use with code like #6.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 23rd, 2008, 02:34 PM
#16
Re: Simpel cursor question
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()))
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 23rd, 2008, 03:40 PM
#17
Thread Starter
Member
Re: Simpel cursor question
It dont want to be in colour! WHY?
-
Jan 23rd, 2008, 03:41 PM
#18
Re: Simpel cursor question
What format is the file?
What method are you using? RobDogs?
-
Jan 23rd, 2008, 03:51 PM
#19
Re: Simpel cursor question
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
-
Jan 23rd, 2008, 03:58 PM
#20
Re: Simpel cursor question
I suspect that if he's using the ImageList way, he needs to set the ColorDepth property to something appropriate.
-
Jan 23rd, 2008, 04:21 PM
#21
Re: Simpel cursor question
Its not nasty 
If the imagelist is not setup for the proper color depth then it will loose color.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|