Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem running my prograss bar

Status
Not open for further replies.

keith23

Technical User
May 26, 2005
97
NL
Hi all i have 2 forms. The second form is called when a command button in first form is cliced.

The problem is that when i click the button the second form pops up but the prograss bar does not run. i used form2.show inside my onclick event in my first form. I put the Timer1.Enabled = True inside onload event of second form but it never works!!I be happy if an expert tell me what is wrong here.Furthermore, i want the second form closes at the end of progress bar.Thanks


Code:
Option Explicit


Private Sub Form_Load()
[b]Timer1.Enabled = True[/b]

    ProgressBar1.Max = 15
    ProgressBar1.Value = 0
    Timer1.Interval = 1000
    Timer1.Enabled = False
   
    
End Sub

Private Sub Timer1_Timer()
    If ProgressBar1.Value < ProgressBar1.Max Then
        ProgressBar1.Value = ProgressBar1.Value + 1
    Else
        Timer1.Enabled = False
        MsgBox "15 Seconds are up!"
    End If
     
End Sub
 
You have also set Timer1.Enabled = False in the Form_Load event!

To hide the form, just use Me.Hide in your Timer1 Else section

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Did this solve it?

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top