Used to specify the appearance of the pointer.







image As Picture, xHotSpot As Integer, yHotSpot As Integer

Method descriptions


Constructor(image as Picture, xHotSpot as Integer, yHotSpot as Integer)


Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a new cursor using the passed image. The hot spots are the x, y coordinates that the operating system uses to track the cursor's position. The upper-left corner of the cursor is position 0,0.

This example creates a new cursor that uses an image that has been added to the Project.

Var c As New MouseCursor(EarthAmericas, 20, 20)


The Cursors module contains a library of standard mouse cursors that you can access by calling System.Cursors.*MouseCursorName*. See the Cursors module for the names and descriptions of the available mouse cursors.

See the MouseCursor properties of the DesktopApplication class, the Window class, and the Control class. The relationships among them are as follows:

The MouseCursor property of a control determines the shape of the mouse pointer when the pointer enters the control's region only if the DesktopApplication MouseCursor property is Nil. Similarly, the Window class's MouseCursor property determines the shape of the pointer when it enters the region of the window only if the DesktopApplication class's MouseCursor property is Nil. If the DesktopApplication class's MouseCursor property is not Nil, then it controls the shape of the pointer and a window's and any control's MouseCursor property values are ignored.

A MouseCursor can be assigned in the following ways:

  • You can use a cursor in the Cursors module.

  • You can use the constructor to create a MouseCursor from an image.

Custom cursors

The preferred way to create a custom cursor is to use the constructor. Create an image of the cursor and add it to the project file. Pass it to the constructor with the coordinates of the x,*y* hotspot. The latter is the point used to track the location of the cursor.

On Windows, you can create cursors with a Windows resource editor and then import the .cur files that it creates into your project. Currently, only 16 x 16 monochrome cursors are supported.

Sample code

The following line changes the pointer to the HandOpen cursor when the mouse enters the region of a Canvas control. The line is in the MouseEnter event handler.

Me.MouseCursor = System.Cursors.HandOpen


All project types on all supported operating systems.

See also

Object parent class; Cursors module; MouseCursor properties of the DesktopApplication class, the Window class, and the DesktopUIControl class; System class.