CodeBlue
CodeBlue

Reputation: 15389

Sequence of Form_Activate() and Form_Load() in 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?

Upvotes: 7

Views: 14565

Answers (2)

GaryNg
GaryNg

Reputation: 1123

you can try it yourself!

Option Explicit

Private Sub Form_Activate()
    MsgBox "Form_Activate"
End Sub

Private Sub Form_Load()
    MsgBox "Fom_Load"
End Sub

Form_Load msgbox always come out first!

Upvotes: 1

Michael
Michael

Reputation: 9068

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.

Upvotes: 13

Related Questions