Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB.Net - Wait Cursor and FormDialog

Posted on 2013-05-21
7
Medium Priority
?
1,176 Views
Last Modified: 2013-05-23
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
0
Comment
Question by:Jimbo99999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 39184469
Try adding application.DoEvents after you set the cursor.
0
 

Author Comment

by:Jimbo99999
ID: 39184928
Thank you responding.  I have done as you suggested but unfortunately no hourglass.  Wow, I can't figure this one out.
0
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 2000 total points
ID: 39185936
http://devlicio.us/blogs/derik_whittaker/archive/2006/10/06/How-to-simply-Manage-Cursor-Changing-for-WinForms-Applications.aspx

Remove the DoEvents and do:

'remember current cursor and set wait cursor.
Dim currentCursor as Cursor = Cursor.Current
Cursor.Current = Cursors.WaitCursor

'At end reset
Cursor.Current = currentCursor
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Jimbo99999
ID: 39187362
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
0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 39188511
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."
0
 

Author Comment

by:Jimbo99999
ID: 39188868
Using just Cursor.current.
0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 39189241
You can ignore it then, it's only a warning.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question