update label text

Posted on 2011-05-02
Last Modified: 2012-06-27
Hi all experts
how can i update the label text when a process take place, it's update at the end of the process in a do while statement, im pass the code in the part that im call the label whit the text i need it, but puts the text until the end of the process and i need it at the begining

thank you a lot

Do While b
                a = Maestro.Item(0, c).Value
                If a = "T" Then

                    Label3.Text = "Migrando SPEC " & Maestro.Item(1, c).Value & " por favor espere...."


                    Dim qry4 As String = "delete  from  proj.pipe_padp"
                    Dim cmd4 As New OleDbCommand(qry4, cn5)
                    estatus = CInt(cmd4.ExecuteScalar())
                    ProgressBar1.Value = 1

                    Dim qry6 As String = "INSERT INTO [1010].proj.PIPE_PADP SELECT * FROM [PASO1008].proj.PIPE_PADP "
                    Dim cmd6 As New OleDbCommand(qry6, cn5)
                    estatus = CInt(cmd6.ExecuteScalar())
                    ProgressBar1.Value = 2

Open in new window

Question by:edo60
    LVL 8

    Expert Comment

    You can crate a background worker thread and update the label text using this thread.
    LVL 85

    Accepted Solution

    The "quick fix" is to call Application.DoEvents() after setting the Label text (each time).

    The "proper" way to do it is via threading as sabeesh suggests.

    Author Comment

    code code pleasee

    Author Comment

    got it
    thank you a lot

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    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…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    761 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

    15 Experts available now in Live!

    Get 1:1 Help Now