I need to make the cursor change while it is executing a specific task, return it to its normality when it finishes.
I need to make the cursor change while it is executing a specific task, return it to its normality when it finishes.
There is a function in this page. Here's the function:
procedure SetControlCursor(control: TWinControl; cursor: TCursor);
var i:Integer;
wc: TWinControl;
begin
if (not (control = nil)) then begin
control.Cursor := cursor;
try
for i:=0 to control.ControlCount-1 do begin
wc := TWinControl(control.Controls[i]);
if (NOT(wc = nil)) then
SetControlCursor(wc, cursor)
else
control.Controls[i].Cursor := cursor;
end; {for}
finally
end;{try}
end;{if}
end;{procedure SetControlCursor}
You call like this:
SetControlCursor(WizardForm, crHourGlass);
To return to normal:
SetControlCursor(WizardForm, crDefault);