Mouse Cursor

  • Thread starter Thread starter George
  • Start date Start date
G

George

I'm stopping and starting the painting of my form while I
move controls. How can I change the mouse cursor and
have the mouse cursor actually paint before the next line
of code excutes? I would hate to use Thread.Sleep(100)
just to give it a chance to paint the mouse cursor.

Basically I'm doing this:

base.Cursor = Cursors.WaitCursor;
FreezePaint(true);

do some stuff

FreezePaint(false);
base.Cursor = Cursors.Arrow;

Thanks for any help,
George
 
Not sure if I got you: You set the mouse cursor to "Wait", and it isn't
updated immediately, right?
I didn't try, but in the good old Win32 SDK days, you had to move the mouse
cursor (GetCursorPos/SetCursorPos) by one pixel so it gets repainted. Maybe
that stupid bug made it into the "managed new world"? Could be worth a try.
Don't know if there's a managed equvalent for SetCursorPos, you might have
to use P/Invoke.

Niki
 
Back
Top