• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

Change Cursor when leaving a Form

After opening a Second Form as a Dialog Box, which is smaller then the Main Form, How do I change the cursor so that when it is over the Dialog Box, it shows as an arrow - and when it has left the Dialog Box, it changes to an Hour glass.

That is the cursor is an hour glass when not over the Dialog Box ?
1 Solution
you can do this:

procedure TForm1.Button1Click(Sender: TObject);
 crHourGlass   = TCursor(-11);
 //you may need to change this const until you find the hourglass
 //seems to depend on how many cursors you have installed
 //mine is 11 but on another pc it was 18
form2.cursor := crhourglass;

you can also call
     SetSystemCursor(Screen.Cursors[crHourGlass], OCR_NORMAL);

     SetSystemCursor(Screen.Cursors[crDefault], OCR_NORMAL);

to change the cursors systemwide.
Regards Barry
chrisedenAuthor Commented:
Even though it reverses what I actual wanted, it has answered another problem, which I had been looking into for a long time.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now