force waitcursor

  • Thread starter Thread starter veerleverbr
  • Start date Start date
V

veerleverbr

Hi,

In my VB.NET code, at a certain moment I set the cursor to the
hourglass:

Cursor = System.Windows.Forms.Cursors.WaitCursor

Then a lot of things happen in my form, but also in other controls on
the form or loaded in memory (but not actually on the form)...
Afterwards, I set my cursor back to normal:

Cursor = System.Windows.Forms.Cursors.Default

But in reality, the cursor changes back to normal way before I want
that.
In the MSDN library they say that this happens when calling
Application.DoEvents, but that's not the case here. I don't have a
single Application.DoEvents in the code in between.

What I would like to know is how I can force the waitcursor to stay
until the moment that I want to set it back to normal?

Any help would be appreciated...

Veerle
 
Hi Veerle,

AFAIK that can happen because of the DoEvents statement, or because other
procedure is setting it back to Default. So, I would simplify your code
removing calls to procedures until you find who is resetting it. I have had
to do that in the past.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 

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

Back
Top