Solved

Display problems in Status strip

Posted on 2011-09-13
3
390 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 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