In what sequence are the Form_Load() and the Form_Activate() functions called in VB6? What does "Activate" mean in the context of forms?
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.
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
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With