B4J Question MainForm_CloseRequest vs. RealNameForm_CloseRequest

KMatle

Expert
Licensed User
Longtime User
I wonder why the _CloseRequest method is only working with MainForm. I would expect the real name like in my example code: LoginForm

It only works with "MainForm". Any ideas?

B4X:
Sub AppStart (Form1 As Form, Args() As String)
    LoginForm = Form1
    LoginForm.RootPane.LoadLayout("LoginLO") 'Load the layout file.
    LoginForm.Show    
End Sub

B4X:
Sub MainForm_CloseRequest (EventData As Event)
    If fx.Msgbox2(LoginForm, "Wollen Sie das Programm beenden?", "Programm beenden?", "Ja", "", "NEIN", fx.MSGBOX_WARNING) <> fx.DialogResponse.POSITIVE Then
        EventData.Consume
    Else
        ...
    End If
End Sub
 
Top