[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

update label text

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...."

                    cn5.Open()

                    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

0
Ernesto
Asked:
Ernesto
  • 2
1 Solution
 
sabeeshCommented:
You can crate a background worker thread and update the label text using this thread.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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.
0
 
ErnestoAuthor Commented:
okey
code code pleasee
0
 
ErnestoAuthor Commented:
ok
got it
thank you a lot
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now