Hi,
<snip>
I'm thinking about nested routines all setting it to true. Then the
innermost routine sets it to false.
I prefer that the UI thread handles the cursor logic and the "routines" just
process the business logic. Therefore, it's more common that the "outer"
routine sets the UseWaitCursor property to true before any of the asynchronous
processes are started and false after the entire operation is completed,
including all sub-routines that are being processed asynchronously. This, of
course, only applies to cases where you really can't allow the user to
interact with the all or part of the UI while the processing is taking place.
In some cases unrestricted user-interaction isn't a problem.
Since it is boolean I'd guess the cursor gets reset on all open forms even
tho some routines are not finished.
When UseWaitCursor is set to true before all of the operations are complete,
yes. Try it yourself to verify.
and that this is something one must make sure does not happen.
Correct?
If you allow sub-rountines to control the cursor logic then yes, you may run
into problems when one process sets UseWaitCursor to false while another
asynchronous process hasn't completed yet. You can prevent this by processing
all UI-related logic on the UI thread only, as I suggested above.
Actually as I think about it one has the same problem setting Forms.Cursor.
Correct?
Yes.
--
Dave Sexton