odonovanpm
asked on
Progress Bar for Loop
I have a loop that send out customised SMS messages to clients, as this loop can take anything from 20 minutes to 1 hour I need to integrate a progress bar to monitor the progress of the loop... Ideally I would like to place it in the Status Bar of the MDI Parent Form... Any ideas?
http://www.codeproject.com/miscctrl/ProgressBar.asp
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In your Child form
Public Event StatusChange (Count as long, Total as long)
Sub RunForLoop ()
Dim SomeArray(8) as String
for c = 0 to ubound(someArray)
'do something
Raiseevent StatusChange (c,ubound(someArray))
msgbox("You Should See " & str(c+1) & " bar(s)"
next
end sub
In your Parent form
Sub ChildFormStatusChangeEvent ( count as long, total as long) handles Childform1.StatusChange
progressbar1.Maximum = Total
Progressbar1.value = count
end sub
Regards,
Corey
Public Event StatusChange (Count as long, Total as long)
Sub RunForLoop ()
Dim SomeArray(8) as String
for c = 0 to ubound(someArray)
'do something
Raiseevent StatusChange (c,ubound(someArray))
msgbox("You Should See " & str(c+1) & " bar(s)"
next
end sub
In your Parent form
Sub ChildFormStatusChangeEvent
progressbar1.Maximum = Total
Progressbar1.value = count
end sub
Regards,
Corey