Loading numerous pictures

  • Thread starter Thread starter Nathan
  • Start date Start date
N

Nathan

Hi,

I have a project with various forms that each include a number of picture
boxes and panels with background images. When these forms first load, they
kind of load in "pieces", with the pictures coming to view consecutively,
even on a 1.6 Ghz processor with 512 MB RAM. The pictures are loaded in the
Form_Load event. Is there a way for them to all load perfectly before the
user sees the form?

Thanks,
Nathan
 
Nathan,

you could try using Me.SuspendLayout() before you start loading all your
child controls and pictures and then call Me.ResumeLayout() after you've
finished loading all of them.

hope this helps..
Imran.
 
Thanks for the suggestion. I tried it but it didn't work. Here's my code:

\\
Private Sub frm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.SuspendLayout()

bmpQuit = New Bitmap(Application.StartupPath & "\Program Data\Quit.mpp")
bmpQuitOver = New Bitmap(Application.StartupPath & "\Program
Data\QuitOver.mpp")
bmpQuitDown = New Bitmap(Application.StartupPath & "\Program
Data\QuitDown.mpp")

bmpBackdrop = New Bitmap(Application.StartupPath & "\Program
Data\Backdrop.mpp")
pbxCover.Image = New Bitmap(Application.StartupPath & "\Program
Data\Backdrop.mpp")
pnlBackdrop.BackgroundImage = Bitmap.FromFile(Application.StartupPath &
"\Program Data\Backdrop.mpp")
btnQuit.Image = bmpQuit

pbxTimer.Image = ShortClock(MaxSeconds) 'ShortClock() IS AN
ARRAY OF BITMAPS, LOADED PRIOR TO

'SHOWING THE FORM

Select Case CurStudent("MF_Problems").ToString
Case "Addition"
pnlFlashCard.BackgroundImage = FlashCard(1) 'FlashCard() IS A
BITMAP ARRAY
Case "Subtraction"
'THE IMAGES ARE LOADED PRIOR TO SHOWING THE FORM
pnlFlashCard.BackgroundImage = FlashCard(2)
Case "Multiplication"
pnlFlashCard.BackgroundImage = FlashCard(3)
End Select

Me.ResumeLayout()
End Sub
\\
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top