|
-
Jan 2nd, 2007, 04:47 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Progress bar with timer?
How do i make a progress keep moving to 100% with a timer liek every 10 seconds?
-
Jan 2nd, 2007, 04:53 PM
#2
Re: Progress bar with timer?
What is the total time?
EG. Do you want the progress bar to progress at a 10 second rate, up till 60 seconds?
-
Jan 2nd, 2007, 04:58 PM
#3
Re: Progress bar with timer?
EG:
VB Code:
Option Explicit
Private Sub Form_Load()
'Set up
ProgressBar1.Min = 0
ProgressBar1.Max = 10
ProgressBar1.Value = 0
Timer1.Interval = 1000 '1 second
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If ProgressBar1.Value >= 10 Then
'When max is reached, disable Timer
Timer1.Enabled = False
Else
ProgressBar1.Value = ProgressBar1.Value + 1
End If
End Sub
-
Jan 2nd, 2007, 05:24 PM
#4
Thread Starter
Hyperactive Member
Re: Progress bar with timer?
I tryed to let it run with a vbyesno msgbox but it closes wether i click yes or no.
-
Jan 2nd, 2007, 07:21 PM
#5
Re: Progress bar with timer?
-
Jan 2nd, 2007, 09:17 PM
#6
Thread Starter
Hyperactive Member
Re: Progress bar with timer?
VB Code:
Option Explicit
Private Sub Form_Load()
MsgBox " Would you like to install MasterControl", _
vbYesNo, "MasterControl"
If vbYes Then
ProgressBar1.Min = 0
ProgressBar1.Max = 20
ProgressBar1.Value = 0
Timer1.Interval = 1000
Timer1.Enabled = True
End If
If vbNo Then
End
End If
End Sub
Private Sub Timer1_Timer()
If ProgressBar1.Value >= 20 Then
Timer1.Enabled = False
Else
ProgressBar1.Value = ProgressBar1.Value + 1
End If
End Sub
-
Jan 2nd, 2007, 09:26 PM
#7
Re: Progress bar with timer?
Like:
VB Code:
Option Explicit
Private Sub Form_Load()
If MsgBox("Would you like to install MasterControl", vbYesNo [b]+ vbQuestion[/b], "MasterControl") = vbYes Then
ProgressBar1.Min = 0
ProgressBar1.Max = 20
ProgressBar1.Value = 0
Timer1.Interval = 1000
Timer1.Enabled = True
Else
ProgressBar1.Visible = False
End If
End Sub
Private Sub Timer1_Timer()
If ProgressBar1.Value >= 20 Then
Timer1.Enabled = False
Else
ProgressBar1.Value = ProgressBar1.Value + 1
End If
End Sub
-
Jan 2nd, 2007, 09:27 PM
#8
PowerPoster
Re: Progress bar with timer?
VB Code:
Private Sub Form_Load()
if MsgBox(" Would you like to install MasterControl", _
vbYesNo, "MasterControl") = vbYes Then
ProgressBar1.Min = 0
ProgressBar1.Max = 20
ProgressBar1.Value = 0
Timer1.Interval = 1000
Timer1.Enabled = True
Else ' vbNo
Unload Me
'DO NOT USE E ND
End If
End Sub
-
Jan 2nd, 2007, 09:31 PM
#9
Thread Starter
Hyperactive Member
Re: Progress bar with timer?
thanks braille i guess i was posting whenever you do it works fine.
Last edited by xypherx; Jan 2nd, 2007 at 09:35 PM.
-
Jan 2nd, 2007, 09:32 PM
#10
Re: Progress bar with timer?
Using Unload Me as BrailleSchool mentioned:
VB Code:
Option Explicit
Private Sub Form_Load()
If MsgBox("Would you like to install MasterControl", vbYesNo + vbQuestion, "MasterControl") = vbYes Then
ProgressBar1.Min = 0
ProgressBar1.Max = 20
ProgressBar1.Value = 0
Timer1.Interval = 1000
Timer1.Enabled = True
Else
Unload Me
End If
End Sub
Private Sub Timer1_Timer()
If ProgressBar1.Value >= 20 Then
Timer1.Enabled = False
Unload Me
Else
ProgressBar1.Value = ProgressBar1.Value + 1
End If
End Sub
Last edited by Bruce Fox; Jan 2nd, 2007 at 09:39 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|