Click here to Skip to main content
11,721,385 members (79,912 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB progress 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
 
Beep()
 
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 1:37am
555336631
Edited 7-Apr-11 1:39am
d@nish 75.1K
v2

1 solution

Rate this: bad
good
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.
  Permalink  
Comments
SAKryukov at 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!
--SA
d@nish at 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
0 Sergey Alexandrovich Kryukov 380
1 OriginalGriff 254
2 Mika Wendelius 170
3 cyycoish 70
4 ppolymorphe 66
0 Sergey Alexandrovich Kryukov 2,249
1 OriginalGriff 1,024
2 F-ES Sitecore 690
3 Maciej Los 619
4 Richard MacCutchan 580


Advertise | Privacy | Mobile
Web01 | 2.8.150901.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