Click here to Skip to main content
13,832,282 members
Click here to Skip to main content
Add your own
alternative version


11 bookmarked
Posted 21 Feb 2010
Licenced CPOL

Use Icons for cursors, not ".CUR"

, 16 Mar 2010
Rate this:
Please Sign up or sign in to vote.
Many developers use ".cur" cursor files. Using them myself in Visual Studio 2008, they are not the easiest things to work with for many reasons.They are not easy to create without expensive software. (unless you are using the editor within Visual Studio)They cannot easily be ported in the...
Many developers use ".cur" cursor files. Using them myself in Visual Studio 2008, they are not the easiest things to work with for many reasons.

  1. They are not easy to create without expensive software. (unless you are using the editor within Visual Studio)
  2. They cannot easily be ported in the express editions of Visual Studio, which leaves most hobbyist developers out. (You must first import them as a resource or
  3. Sometimes they can be hard to even link into your code.

To get around using ".cur" files for your cursors, We will be using Icons. With Icons you can still use transparency and create shadows.

You may use either Visual Studio or the VB.NET Express edition(which is free for use):

Step 1:

Create a new project

note : I am using VB Express

This menu shows the generic Windows cursors

You can access this menu by code as shown.
<img src=""/

Step 2:

Getting it ready

To create cursors from icons, you must obviously have an icon to do so with. There are many programs you can use the many Devs or hobbyists might have. I am going to use GIMP: {New window}

GIMP is a free photo manipulator similar to Photoshop, but it can also be used for image creation.

If you do not have an image to use or create, right-click and save this one :

Step 3:

Making it work

Import the Icon as a resource.
Choose the option "Add existing file"

Make sure that the Access Modifier is set to "Public"

Simply put the code that lets the icon get a handle so that it might be used as a cursor.
Me.Cursor = New Cursor(My.Resources.Form1.cursor.Handle)

The finished project

The only foreseeable problem with the use of an icon as a cursor is that the location of the pointer will be in the center of the cursor. This can be easily overcome by making the image larger, while keeping the image in the lower-right corner. As shown:

I also added a shadow to the cursor.

Thank you for reading my Tips 'n Tricks post. I hope to see you in later tips or articles. :cool:

EDIT: I added a dotted line to the last cursor illustrating where the cursors hotspot will be. I also added a shadow to that cursor.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Student Student
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionGood Work ...... Pin
C0D3R1N_L0G26-Jun-15 2:35
memberC0D3R1N_L0G26-Jun-15 2:35 
Questionthx Alot Pin
Ahmed_online4-May-13 11:12
memberAhmed_online4-May-13 11:12 
QuestionGreat job! Quick question. Pin
JCI Hunter5-Sep-12 11:20
memberJCI Hunter5-Sep-12 11:20 
AnswerRe: Great job! Quick question. Pin
Globin19-Dec-12 10:40
memberGlobin19-Dec-12 10:40 
GeneralMy vote of 5 Pin
nmanjusha16-Apr-12 23:51
membernmanjusha16-Apr-12 23:51 
GeneralReason for my vote of 5 Very Simple and Handy Pin
ArghavanMostafa13-Jun-11 9:08
memberArghavanMostafa13-Jun-11 9:08 
GeneralReason for my vote of 5 That's awesome! Pin
User97016-Aug-10 5:57
memberUser97016-Aug-10 5:57 
GeneralCursor Software Pin
Brisingr Aerowing16-Mar-10 15:51
professionalBrisingr Aerowing16-Mar-10 15:51 
GeneralRe: Cursor Software Pin
Bill96034-Apr-10 18:08
memberBill96034-Apr-10 18:08 
GeneralRe: Cursor Software Pin
LittleBlueBird20-Apr-10 6:11
memberLittleBlueBird20-Apr-10 6:11 
GeneralRe: Cursor Software Pin
Globin21-Dec-12 6:17
memberGlobin21-Dec-12 6:17 
GeneralRe: Cursor Software Pin
LittleBlueBird13-Apr-13 6:00
memberLittleBlueBird13-Apr-13 6:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web05 | 2.8.190114.1 | Last Updated 16 Mar 2010
Article Copyright 2010 by Bill9603
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid