Click here to Skip to main content
15,615,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Help me with LABEL in progress Bar:

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

ProgressBar1.Maximum = 200

ProgressBar1.Value = ProgressBar1.Value + 1

If ProgressBar1.Value = ProgressBar1.Maximum Then

Label1.Visible = True

Label1.Text = "I love you"

Timer1.Enabled = False

ProgressBar1.Value = 0


ProgressBar1.Visible = False

End If

End Sub

As you see, once the progress bar stops, it displays the label "I love you", however, I want that once the progress bar starts, it displays the label, and also how to display more texts until the progress bar finish?

I mean I want to display also some other texts like "I can't live without you", "You are my life", just after the label I love you has been displayed. The process must start when the progress bar starts and finish when the progress bar finishes. Each label must be changed in each 3 seconds.
Updated 7-Apr-11 1:39am

1 solution

There is something called ReportProgress event associated with the progress bar. You can probably use that to update the text.
Share this answer
Sergey Alexandrovich Kryukov 7-Apr-11 7:49am    
Absolutely, my 5.
But I smell how it may end up. OP will ask again and again and it may end up with parallelism (and maybe even DoEvents instead of thread), but finally comes to a thread. Let's see!
dan!sh 7-Apr-11 7:58am    
I will go offline in few minutes for sometime. Then it will be intermittent internet access since I will be travelling. So all the best to you and others. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900