Here is a handy way to create and use custom cursors in your application from common Png image files. You can either add the Png images to your application`s Resources or you can load them from the hard drive. This method will allow you to set the X and Y hotspot of the cursor too.
This will create the cursor the same size as the bitmap image you use to create the cursor. Cursor files can only be a maximum of 512x512 but, i would recommend sticking with standard cursor sizes for your images such as 24x24, 32x32, 48x48, or 64x64.
Here is a Png image you can right click on and save to your hard drive for testing this example out.
First add the CursorHelper class to your project.
If you just wish to set some custom cursors when the form loads and do not plan on changing them at runtime then here is a simple example for doing that.
'I imagine that as the form and all of its controls are disposed that the Cursors would be disposed too since they Implement IDisposable.
'However, i like to Dispose them myself when the form is closing just to be sure they are destroyed and i have no memory leaks.
If you want to use one or more cursor for a control such as one cursor when the mouse is pressed down on a Button and another when the mouse is released, here is an example of doing that.
'on it when the Form is closing. So, you need to be sure to Dispose of the cursors.