Speed up form load time at run-time

I am using code to load windows... the problem is that the crystal report windows take forever to load at run time...

Example of a form load:

     Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If Lookup_Account_Form Is Nothing Then
            Lookup_Account_Form = New Lookup_Account
            Lookup_Account_Form.Show()
        End If
        Me.Hide()
        Primary_Screen_Form = Nothing
    End Sub

Example of that form returning back:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Primary_Screen_Form Is Nothing Then
            Primary_Screen_Form = New Primary_Screen
            Primary_Screen_Form.Show()
        End If
        Me.Hide()
        Lookup_Account_Form = Nothing
    End Sub

Any ideas on how to fix this issue... load at program start?  Load forms into memory?  Other ways to do what I have done here?

Thanks,
John
LVL 3
jdraggiAsked:
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.

The_BiochemistCommented:
You could try binding the datasource at runtime rater than at design tme that may reduce the overhead whilst trying to load the page if CR is trying to populate it as it loads, maybe!
GivenRandyCommented:
You could create the forms during the app startup and only do the Show when requested. For example, a bunch of:

frmMyForm1 = new MyForm1
frmMyForm2 = new MyForm2

Then, when you need them:

If (someCondition) Then
 frmMyForm1.Show
End If

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
jdraggiAuthor Commented:
GivenRandy , sounds like a good idea... I'll try to check in to that today!

Thanks!
--John
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.