Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing the cursor

Status
Not open for further replies.

andrews2004

Programmer
Oct 27, 2004
3
GB
When a button is clicked on my form I change the cursor to an hour glass while it is performing various operations.

As long as the cursor is hovering over my form the hourglass cursor is displayed. However, as soon as I move over a different window, the cursor changes.

What I want to do, is set the cursor to the type defined by window which has focus, i.e. my application, rather than that belonging to the particular window that the cursor happens to be moved over.

I'm not sure if this is possible or not, but I would be very grateful if anybody could help me with this.
 
thanks for your help, but unfortunately the cursor property of application does not seem to exist when i try to set it. I am using D7 professional.

many thanks, andrews2004
 
Hi,

try this :

Code:
procedure test;
  SaveCursor    :TCursor;

begin
 SaveCursor := Screen.Cursor;
 try
  Screen.Cursor:=crHourGlass;
  // do some lenghty operation
  ...
 finally
  Screen.Cursor := SaveCursor;  { Always restore to normal }
 end;
end;

--------------------------------------
What You See Is What You Get
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top