[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
[Thread Prev] | [Thread Next]
- Subject: The Form_Open event does not trigger if event are handled in another class
- From: Bruce Steers <bsteers4@xxxxxxxxx>
- Date: Thu, 30 Apr 2026 13:20:14 +0100
- To: Gambas Mailing List <user@xxxxxxxxxxxxxxxxxxxxxx>
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