Solved

Display problems in Status strip

Posted on 2011-09-13
3
389 Views
Last Modified: 2012-06-27
I want the status strip to change when certain commands are being executed in the button click event. I only see the "Status: Change Complete..." notice and not the other ones before that.

any ideas why?
Private Sub btnSet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSet.Click
        Try
            Me.Enabled = True
            ValidateInformation()
            Me.CommandReceived.Text = "Status: Validating Changes....."
            Send_Struct()
            Me.Cursor = Cursors.WaitCursor
            System.Threading.Thread.Sleep(500)
            serialCOMDiscover.Write(Door_Message1)
            Me.CommandReceived.Text = "Status: Sending Changes 1 of 5....."
            System.Threading.Thread.Sleep(500)
            serialCOMDiscover.Write(Door_Message2)
            System.Threading.Thread.Sleep(500)
            Me.CommandReceived.Text = "Status: Sending Changes 2 of 5....."
            serialCOMDiscover.Write(Door_Message3)
            System.Threading.Thread.Sleep(500)
            Me.CommandReceived.Text = "Status: Sending Changes 3 of 5....."
            serialCOMDiscover.Write(Door_Message4)
            System.Threading.Thread.Sleep(500)
            Me.CommandReceived.Text = "Status: Sending Changes 4 of 5....."
            serialCOMDiscover.Write(Door_Message5)
            System.Threading.Thread.Sleep(500)
            Me.CommandReceived.Text = "Status: Sending Changes 5 of 5....."
            Me.Cursor = Cursors.Arrow
            Me.CommandReceived.Text = "Status: Changes Complete....."
            Me.Enabled = True
        Catch ex As Exception
            Me.CommandReceived.Text = "Parameters could not be sent. Please check Device"
        End Try
    End Sub

Open in new window

0
Comment
Question by:cmdolcet
[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
  • 2
3 Comments
 
LVL 40
ID: 36529425
Try Application.DoEvents instead of Sleep. This completes the writing of the Text to the control before going to the following line. Sleep simply stops everything.
0
 

Author Comment

by:cmdolcet
ID: 36529450
Can I see an example of this?
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 125 total points
ID: 36529657
...
Me.CommandReceived.Text = "Status: Sending Changes 1 of 5....."
Application.DoEvents()
serialCOMDiscover.Write(Door_Message2)
...

Open in new window

0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.net and sql server 4 54
Visual Studio hangs on running project 6 61
VB.Net - BackgroundWorker running multiple 5 47
CHANGE FORM TEXT BEFORE IT SHOW TO USER 13 19
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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