By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,593 Members | 2,006 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,593 IT Pros & Developers. It's quick & easy.

How do i make a fully working progress bar?

P: 37
um, mine progress bar isnt working, it come up with an error like this



this is the code
Expand|Select|Wrap|Line Numbers
  1. Private Sub Timer1_Timer()
  2. Timer2.Enabled = True
  3. If ProgressBar1.Value = "90" Then
  4. Timer1.Enabled = False
  5. Label1.Caption = "Rofl Pantofl"
  6. End If
  7. End Sub
  8.  
  9. Private Sub Timer2_Timer()
  10. ProgressBar1.Value = ProgressBar1.Value + 10
  11. If ProgressBar1.Value = "200" Then
  12. Label1.Caption = "uber roflpantofl"
  13. End If
  14. End Sub
  15.  
I use vb6.
Nov 23 '06 #1
Share this Question
Share on Google+
1 Reply


100+
P: 267
um, mine progress bar isnt working, it come up with an error like this



this is the code
Expand|Select|Wrap|Line Numbers
  1. Private Sub Timer1_Timer()
  2. Timer2.Enabled = True
  3. If ProgressBar1.Value = "90" Then
  4. Timer1.Enabled = False
  5. Label1.Caption = "Rofl Pantofl"
  6. End If
  7. End Sub
  8.  
  9. Private Sub Timer2_Timer()
  10. ProgressBar1.Value = ProgressBar1.Value + 10
  11. If ProgressBar1.Value = "200" Then
  12. Label1.Caption = "uber roflpantofl"
  13. End If
  14. End Sub
  15.  
I use vb6.
hi

declare your progressbar.value as value, not as string !
If ProgressBar1.Value = "90" Then
should be
If ProgressBar1.Value = 90 Then

look at your progressbar property: max and min
values should lay between those 2 values

in case the progressbar.value should exceed the max-value
build an errortrap such as


if Newvalue>Progressbar.Max then
Newvalue=Progressbar.Min
else
ProgressBar.Value=NewValue
endif
Nov 23 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.