Hiding forms whilst repainting

Posted on 2005-04-11
Medium Priority
Last Modified: 2012-05-05
I have an application which uses three forms, but implements a tab control to give the illusion of being a single-form application.  There is a problem when I switch from one form to another using code like this:

'''We are in the form frmFirst

The controls from frmSecond slowly appear over frmFirst and it looks ugly.  I have two related questions:

1 How do I switch off screen updates whilst the controls are being drawn

2 The first time the a form is activated it takes several seconds longer.  I want to show a title form first when the application starts, and at the same time load the forms into memory but without them showing.  Is there a way to do this?

My hunch is that this is easy, but darned if I can find it in the VB help pages.

Question by:jfell
LVL 32

Accepted Solution

Erick37 earned 200 total points
ID: 13755643
1) Check the LockWindowUpdate API function to prevent your window from redrawing.

2)  Use:
Load Form1
to load a form into memory - but not show it.
Use Form1.Show when you are ready to show the form.

Author Comment

ID: 13756229
2) Works! :-)

1) It looks promising, but I need to start something else right now, so I've accepted the answer in faith.




Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question