Discussion Locked

Loading a VB form in the background

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a very simple application with two forms. First form is a simple form for userid input and the second form is more complex. While the first form is waiting for user to input the userid and password, I would like to load the second form in memory. This way, after successful entry of userid, the second form can be displayed instantly with minimum delay. How do I do this ? Is there an event in VB that indicates that the form has been loaded and now waiting for user input ? Thanks much.

7 replies

by kyle b.

out this in the form.load of the first form:

Load frmForm2
'change this to reflect the name of the second form obviously

then when you want the form to be displayed:

frmForm2.Show

let me know how it goes
Kyle

by francodacosta

in VB a Form is loaded with the first reference to the form, not just with the .Load method, and becames visible with the .Show method or by setting the visible property to true after the form is loaded

In order to speed up loading time you should avoid having a complex Form_Load Event.

If you want to find out when the form is loaded just use a boolean variable that is set to true in the last line of the Form_Load Event

by rrv

Even if you load or refer to the second form from first form to load while showing the first one the system will take the same time to load the second form although without showing.
to avoid this do not load any control or data in the form load event. write functions which load data. call these functions whenever the user is inputting data in the first form and use doevents in those functions.
this logic definitely helps me while i load huge data from AS/400 server into VB grids.

All thebest
RV

This discussion is closed to new replies.