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!

ProgressBar Question

Status
Not open for further replies.

MikeBronner

Programmer
May 9, 2001
756
US
I have a somewhat different question regarding the progress bar. Its functionality is clear, and I know how to increment it.

However, I would like to measure the progress of the program being started. I have a splash form when the user starts my application. On this form I would like to display the status of the program being loaded. Is this possible?

Thanks! Best Regards and many Thanks!
Michael G. Bronner X-)

"They who drink beer will think beer." Washington Irving
 
If you have many different items you are loading while the splash screen is displayed, the after each item is loaded, update the progress bar. If you have four commands then

progBar.value=0
command one
progBar1.value = 25
command two
progBar1.value = 50
command three
progBar1.value = 75
command four
progBar1.value = 100

see if that works for you
 
Hmmm.... I might have to restructure my program.

My program starts with the Form_Load method of the splash screen. and when the splash is loaded, it loads the program's MDIForm.

Should I write a Sub Main() and load each form individually instead?

I've never used the Sub Main() before. Can you give me any pointers in that area? Thanks for your help! Best Regards and many Thanks!
Michael G. Bronner X-)

"They who drink beer will think beer." Washington Irving
 
Well, try this then. After your splash screen is loaded, use a for next loop from 1 to 100 to update your progress bar to give the illusion that it is loading something. When the for next loop is complete, load the main form and unload the splash screen.

You will need to use a nested for next loop to indicate a pause in the status bar updating.

Something like
for x=1 to 100
for y=1 to 10000 (change depending oo comp speed)
next y
progbar1.value=x
next x
unload frmSplash
 
Michael,

Using a sub Main, you could define a public variable

Public fSplash as frmSplash 'your splash form

Sub Main()
set fSplash = New frmSplash
fSplash.Show
Load MDIForm1
End Sub


in the MDIForm1 you can load your other forms and since
the fSplash is public you can update the Progressbar from
every place you want. So you could do the update in Sub Main too.


Private Sub MDIForm1_Load()
load form1
fSplash.ProgressBar = 25
load form2
fSplash.ProgressBar = 50
load form3
fSplash.ProgressBar = 75
load form4
fSplash.ProgressBar = 100

End Sub


Herman :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top