Vcl.Forms.TScreen.Cursors

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Cursors[Index: Integer]: HCURSOR read GetCursors write SetCursors;

C++

__property HICON Cursors[int Index] = {read=GetCursors, write=SetCursors};

Properties

Type Visibility Source Unit Parent
property public
Vcl.Forms.pas
Vcl.Forms.hpp
Vcl.Forms TScreen

Description

Lists the cursors available to the application.

Use Cursor to access a particular cursor for use by the application or by a control within the application. TScreen includes several built-in cursors that are indexed by symbolic cursor constants such as crDefault. The image associated with the built-in cursor constants can be changed by setting the Cursors property.

Custom cursors can be added to the Cursors property for use by the application or any of its controls. To add a custom cursor to an application, you can either use two bitmaps (one for the normal image and one for the mask image) to create an icon and load it manually to the Cursors property, or follow the next steps:

  1. Create the cursor resource using a resource editor.
  2. Declare a cursor constant with a value that does not conflict with an existing cursor constant.
  3. Use the Windows API function LoadCursor or LoadImage to obtain a handle to the new cursor.
  4. Set the Cursors property, indexed by the newly declared cursor constant, to the handle obtained from LoadCursor.

Note: Do not call the Windows API function DestroyCursor when finished with a custom cursor; it is handled automatically.
If you use the first method (create an icon from two separate images and load it manually to the Cursors property), the DestroyIcon method is required.


See Also

Code Examples