try like this
Code:Option Explicit Dim cnt As Integer Dim PrdAr Private Sub Form_Load() PrdAr = Array("Product1", "Product2", "Product3", "Product4", "Product5", _ "Product6", "Product7", "Product8", "Product9", "Product10") Picture2.Height = Picture1.Height Picture2.BackColor = vbBlue Picture2.Width = 0 tm.Enabled = True tm.Interval = 1 End Sub Private Sub tm_Timer() Picture2.Refresh Picture1.Refresh cnt = cnt + 1 Label1.Caption = cnt & " % " If cnt Mod 10 = 0 Then Label2.Caption = PrdAr(Int(cnt / 10) - 1) End If If cnt > 100 Then Picture2.Width = Picture1.Width cnt = 0 Unload Me Else Picture2.Width = (cnt / 100) * Picture1.Width End If End Sub





Reply With Quote