Quick Intro (Skip to get to the problem)
Having recentely started with VB 6.0, I've been trying to experiment as much as possible.
Through a number of tutorials I have managed to produce functional app's, although they wouldn't help people out much ...
I want to use a variable to build part of an object name, so it selects an object to increase the value of in a progressive order, triggered by 'Timer'.
(I have declarations, but for now i shall omitt)
If OBJECT(VARIABLE).Value Is 100 Then VARIABLE = VARIABLE + 1
Else OBJECT(VARIABLE).Value = OBJECT(VARIABLE).Value + 5
I believe that I i probably haven't explained very well...
I am trying to experiment with progress bars, and am trying to simplify some code I have made.
The code I am trying to streamline is the follow:
Private Sub Form_Load() Full = "" End Sub Private Sub Timer1_Timer() Select Case Pb1.Value Case Is < 100 Pb1.Value = Pb1.Value + 1 Case 100 Select Case Pb2.Value Case Is < 100 Pb2.Value = Pb2.Value + 1 Case 100 Select Case Pb3.Value Case Is < 100 Pb3.Value = Pb3.Value + 1 Case 100 Timer1.Interval = 0 End Select End Select End Select End Sub
I hope this update helps...
In my code I have a variable declared (integer), which i shall call 'Number'
I wish to execute code that uses 'Number' to build part of the name of an object
The form currentely contains 3 Progress bars, usefully named 'Pg1', 'Pg2', 'Pg3' and a timer, named 'Timer'
I wish for on timer, +10 to be added to the first Pg bar, until Pg1 = 100 (using conditional statement) is full, at which 'Number' will increase one
Basically - I wish to know how to make it so it will use 'Number' to fill in the appropriate number in the name, that it will automatically move from 'Pg1', to 'Pg2', to 'Pg3'.
If you are able to decypher that all, well done...
Even better, Can you help ?
Thanks if you have read this far,
Edited by ChrisWright, 04 August 2006 - 06:04 AM.