Why doesn't my cursor change to an Hourglass in my FindDialog in Delphi?

Posted by lkessler on Stack Overflow See other posts from Stack Overflow or by lkessler
Published on 2010-04-18T01:55:12Z Indexed on 2010/04/18 2:03 UTC
Read the original article Hit count: 462

Filed under:
|
|
|

I am simply opening my FindDialog with:

FindDialog.Execute;

In my FindDialog.OnFind event, I want to change the cursor to an hourglass for searches through large files, which may take a few seconds. So in the OnFind event I do this:

Screen.Cursor := crHourglass;
(code that searches for the text and displays it) ...
Screen.Cursor := crDefault;

What happens is while searching for the text, the cursor properly changes to the hourglass (or rotating circle in Vista) and then back to the pointer when the search is completed.

However, this only happens on the main form. It does not happen on the FindDialog itself. The default cursor remains on the FindDialog during the search. While the search is happening if I move the cursor over the FindDialog it changes to the default, and if I move it off and over the main form it becomes the hourglass.

This does not seem like what is supposed to happen. Am I doing something wrong or does something special need to be done to get the cursor to be the hourglass on all forms?

For reference, I'm using Delphi 2009.

© Stack Overflow or respective owner

Related posts about delphi

Related posts about cursor