Home » Controls » How to use Image control to behave like a progress bar
How to use Image control to behave like a progress bar
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 'Controls - How to use Image control to behave like a progress bar 'This demonstrates an image control behaving like a progress bar. Private Sub Form_Load() 'put 4 textboxes on a form 'put one image control and load a picture into it 'text1 is the seconds duration chopwatch = Val(Text1) Start = Timer Text2 = Text1 Do While Timer < Start + chopwatch DoEvents Form1.Show Text1 = (Val(Text2)) - Val(Text3) Text3 = Str(Val(Timer - Start)) & " " & "Seconds" 'this controls progress imagebar Textpercent = Val(Text3) / Val(Text2) * 100 'this is the image stretched to fit statI.Width = (Val(Textpercent) * ((Text2.Width / 100) - 0.33)) 'to text2's width the .33 is a stretch adjustment Loop End Sub |
Enjoy this article?
Filed under: Controls
Leave a comment