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
Solved

Display problems in Status strip

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
.NET tools for adding thread safety to a web app? 3 48
VB.net and sql server 4 45
VB.NET 2008 - SQL Timeout 9 34
Create a datatable in vb.net dynamically 1 22
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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