WaitCursors not reverting to original type

C

CaptainCaveman

Hi,

This is probably very simple, but after hours of trying and googling I cant
resolve my problem.

Whilst my app is running a thread to read data from a database I wish to
display the wait cursor.
When it has finished retrieving I wish for the cursor to retun to the
original.

The problem I have is that the cursor doesnt revert to the original style
until the cursor has been moved. This kind of defeats the object of the wait
cursor as it is not clear that the thread has completed acquiring data.

I have used the control UseWaitCursor and set it to true and false as
required, but it simply doesnt redraw until the mouse is moved.
I have tried taking a copy of the cursor prior to starting the thread
(Cursor.Current), but for some unknown reason the cursor is always set to
Cursor.WaitCursor so I keep getting the wait cursor at all times.

Can someone please point me in the right direction to resolving my problem
with the Cursors.

Thanks
 
P

Peter Morris

I usually do something like

Cursor original = Cursor.Current;
Cursor.Current = Cursors.WhateveryouLike;
try
{
}
finally
{
Cursor.Current = original;
}
 

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