Progress on Loading Images.

Hi,

I have a form that needs to load many images.
I want to show the form first and then have a progress bar when loading those images.

Please help how to do it.

Thank you.
LVL 1
emi_sastraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jorge PaulinoIT Pro/DeveloperCommented:
Hi again,

You can do this on form load:
ProgressBar1.Minimum = 0
ProgressBar1.Maximum = TotalOfPictures

Then while you are adding the pictures

ProgressBar1.Minimum += 1
Application.DoEvents()
0
Jorge PaulinoIT Pro/DeveloperCommented:
TotalOfPictures = number of the pictures to load. You must calculate this.
0
emi_sastraAuthor Commented:
Hi jpaulino,

The problem is the form is not showing when loading images.
Could I show the form first?

Thank you.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Jorge PaulinoIT Pro/DeveloperCommented:
Add a timer to your form with a interval of 1 second (1000 miliseconds) and enable it on the end of the form load. Then on timer1.tick you start to load the pictures. This will delay the picture to load and shows the form.
0
Jorge PaulinoIT Pro/DeveloperCommented:
Don't forget when timer1.tick event start to disable i'm in the beginning using:

Timer1.Enabled = False
0
emi_sastraAuthor Commented:
Hi jpaulino,

Could you provide code as you mentioned?

Thank you.
0
Jorge PaulinoIT Pro/DeveloperCommented:
Add a timer to your Project and then do this:

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    ' Any code that you do in form load (except loading the pictures)
      
    Timer1.Interval = 1000
    Timer1.Enabled = True
End Sub

Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick
     Timer1.Enabled = False
    ' Load the pictures here
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
emi_sastraAuthor Commented:
Hi jpaulino,

Thank you very much for your help.
0
Jorge PaulinoIT Pro/DeveloperCommented:
Glad I could help and thanks for the grade.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.