FormInForm and Eventhandling
Posted
#1
(In Topic #1044)
Trainee
Code
' Form1 (parent)
Public Sub Form_Open()
Form2.Load(Me)
End
Public Sub Form2_AnyEvent(sData As String)
Debug sData
End
' Form2 (embedded)
Event AnyEvent(Data As String)
Public Sub _new()
Dim bResult As Boolean
bResult = Raise AnyEvent("AnyData")
If bResult Then Debug "canceled"
End
But that's not working. I know, the embedded Form keeps its own Observer, but shouldn't the parent receive those events? What's wrong in this code?
Thanks!
Posted
Guru

Because you add Form2 manually you'll need to set up your own observer.
Or you can add Form2 to Form1 like this…
The f2 can be local and use Last in the events to refer to it.
Or make f2 public (and a better name)
1 guest and 0 members have just viewed this.



