Hiding the houglass

D

Doug Tumeo

I have a small bit of code that allows the user to pick a shape, then click a
command bar button once the shape is selected. Due to the need for response
while the user works in the interface, this needs to happen with the code
still running, so I use a Do/While loop with a DoEvents inside it.

Under this scenario, the user interface presents an hourglass for the mouse
pointer. Is there any way to return it to the pointer (or better yet, a hand)
while the code is still running? If yes, how?

Thanks in advance!
 
P

Paul Herber

I have a small bit of code that allows the user to pick a shape, then click a
command bar button once the shape is selected. Due to the need for response
while the user works in the interface, this needs to happen with the code
still running, so I use a Do/While loop with a DoEvents inside it.

Under this scenario, the user interface presents an hourglass for the mouse
pointer. Is there any way to return it to the pointer (or better yet, a hand)
while the code is still running? If yes, how?

Screen.MousePointer = vbHourglass
or similar

here's a typical agorithm for setting and restoring the cursor

var
Save_Cursor: TCursor;
begin
Save_Cursor := Screen.Cursor;
Screen.Cursor := crHourGlass; { Show hourglass cursor }
try
{ Do some lengthy operation }
finally
Screen.Cursor := Save_Cursor; { Always restore to normal }
end;
end;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top