[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The Form_Open event does not trigger if event are handled in another class


I have just noticed this when using gb.form.mdi Workspace

This is scenario....

Form1 has a Workspace object.

Form2 is the form to add to the workspace tabs.

Form2 has a Public Sub Form_Open() method that does some initialization.

I add a Form2 instance to the workspace in form1 Like so...

Dim f As Form2
f = New Form2
Workspace1.Add(f)

All is okay with that method.

But if i use "As" to monitor events with a handler in Form1 like this...

Dim f As Form2
f = New Form2 As "Form2"
Workspace1.Add(f)

Then the Form_Open() method  in Form2 is not run (nor Form_Close on exit)

I do not expect the sources "Form" events from From2 to be hidden from
itself.

Is this a bug or just an unavoidable "Attach" thing i must code around?

Respects
BruceS