Click here to Skip to main content
11,930,069 members (47,495 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET
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.
Posted 7-Apr-11 2:37am
Edited 7-Apr-11 2:39am
d@nish 75.8K

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

There is something called ReportProgress event associated with the progress bar. You can probably use that to update the text.
SAKryukov 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!
d@nish 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151126.1 | Last Updated 7 Apr 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100