Am I restricted to the cursor numbers defined in Controls.pas under Delphi 7?

前端 未结 3 681
温柔的废话
温柔的废话 2021-01-24 23:49

I am using Delphi 7 under Windows 7 to download files.

I want to change the cursor during the download.

I set the Screen.Cursor := crHourG

3条回答
  •  误落风尘
    2021-01-25 00:22

    crHourGlass is of type TCursor, which is an integer alias (more or less). It is an Index that can be used to set a cursor from stock.

    You can add cursors using

    Screen.Cursors[Number] := ...   needs to be a HCURSOR.
    

    So if you have a handle to a new cursor, you can use that in Delphi.

    Note that the crXXX constants an the TCursor type are defined in Controls and the Screen class is defined in Forms. So you can see the code for yourself.

提交回复
热议问题