Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sequence of Form_Activate() and Form_Load() in VB6

Tags:

vb6

In what sequence are the Form_Load() and the Form_Activate() functions called in VB6? What does "Activate" mean in the context of forms?

like image 665
CodeBlue Avatar asked Apr 05 '12 21:04

CodeBlue


People also ask

What is form_load event in VB6?

Form Load Event in.NET In.NET the Form Load is executed when the form is displayed for the first time. So it can have some slight difference with the Form_Load in VB6. If in VB6 for example you do something like Form1.Caption = "Hi" that will trigger the Form_Load event even if the form is not shown.

What is the difference between form_loadevent and activateevent?

12 From KB138819: The Form_Loadevent fires when a form is first loaded into memory. and [...] the Activateevent is called every time a form becomes the active window, as long as the focus has moved between forms in the application. Share Improve this answer

Why does the form's activate and load events fire frequently?

The Activate event fires most often (at least on a multi-form application) because the user can navigate back and forth between forms many times after the forms are loaded in memory and visible. If the form is loaded, unloaded, and re-loaded into memory several times in the application, then the form's Load event will fire at each load.

Why do I need to load multiple forms in VB?

This enables the programmer to load multiple forms that may be required and to prepare them with information before display. Once loaded into memory, the form's controls and any program code can be used. When working with forms in VB, it is important to note that any reference to an object will cause that object to load.


1 Answers

From KB138819:

The Form_Load event fires when a form is first loaded into memory.

and

[...] the Activate event is called every time a form becomes the active window, as long as the focus has moved between forms in the application.

like image 110
Michael Avatar answered Oct 03 '22 06:10

Michael