Solved

Display problems in Status strip

Posted on 2011-09-13
3
382 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
  • 2
3 Comments
 
LVL 40

Expert Comment

by:Jacques Bourgeois (James Burger)
Comment Utility
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
Comment Utility
Can I see an example of this?
0
 
LVL 40

Accepted Solution

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

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now