Link to home
Start Free TrialLog in
Avatar of Jimbo99999
Jimbo99999Flag for United States of America

asked on

VB.Net - Wait Cursor and FormDialog

Good Day Experts!

I am really quite perplexed with my current issue and hope it is something simple.

I have a Startup form with 3 radio buttons.  The User picks one and hits <GO>.  The code behind the <GO> button is:

If rbtnBatchStatus.Checked = True Then
      BatchStatus.ShowDialog()
ElseIf rbtnRaterStatus.Checked = True Then
      RaterStatus.ShowDialog()
ElseIf rbtnPkgStatus.Checked = True Then
      PkgStatus.ShowDialog()
End If

In the Load_Event of each form I am running queries to load ComboBoxes and DataGrids. So, I have the waitCursor at the top of the Load_Event.  I use the following just like all my other projects:

Me.Cursor = System.Windows.Forms.Cursors.WaitCursor

Then in the Finally part of the Try/Catch I put the following just like all my other projects:

Me.Cursor = System.Windows.Forms.Cursors.Default

My issue is that the cursor never changes to the hourglass which leaves the User wondering.  Granted, the most I have seen was maybe 4-5seconds depending on the volume.  

Do you see any issues with how I am trying to this?

Thanks,
jimbo99999
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Try adding application.DoEvents after you set the cursor.
Avatar of Jimbo99999

ASKER

Thank you responding.  I have done as you suggested but unfortunately no hourglass.  Wow, I can't figure this one out.
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for responding.  It works now.  But there are green lines under "Cursor.Current".
When I hover over it, the message says "Access of shared members, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated".

Is this ok or do I have additional lines of code I need?

Thanks,
jimbo99999
are you using me.cursor.current or just cursor.current?

http://bytes.com/topic/visual-basic-net/answers/463398-net-2-0-conversion-wizard-flags-me-cursor

You can ignore the warning but if you're using me.Cursor.Current get rid of the "me."
Using just Cursor.current.
You can ignore it then, it's only a warning.