2863:How to use a custom cursor.

2863:How to use a custom cursor.

KEYWORDS: custom cursor AREA: VCL Programming

Q:  How do I use one of the cursor files in the c:\delphi\images\cursors?

A:  Use the image editor to load the cursor into a RES file.
    The following example assumes that you saved the cursor in the RES file
    as "cursor_1", and you save the RES file as MYFILE.RES.

(*** BEGIN CODE ***)
{$R c:\programs\delphi\MyFile.res}   { This is your RES file }

const PutTheCursorHere_Dude = 1;     { arbitrary positive number }

procedure stuff;
begin
  screen.cursors[PutTheCursorHere_Dude] := LoadCursor(hInstance,
                                                      PChar('cursor_1'));
  screen.cursor := PutTheCursorHere_Dude;
end;



        TI

DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.


Return to Complete TI List