Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

UseWaitCursor not working but Cursor = Cursors.WaitCursor does...

$
0
0

I'm trying to make use of the UseWaitCursor property of a control - in this case the main Form of my app. I just thought I'd try and make it have a little more feedback.
 
All I've done is this:
void someEventHandler(...)
{
    main_form->UseWaitCursor = true;
    <
        Do something really long
    >
    main_form->UseWaitCursor = false;
}

But unfortunately that doesn't seem to work quite as I expect.
I know that UseWaitCursor works ok by itself because if I don't set it back to false at the end of the function I will get the hourglass.
 
The problem is that it doesn't seem to change to an hourglass until the function returns - by which time its to late.
 
I also tried to use the System.Windows.Forms.Application.UseWaitCursor but it has the same issue.

But if I change the main_form->UseWaitCursor = true to main_form->Cursor = Cursors.WaitCursor then it works fine.

Any ideas why?


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>