Working inside subs here (just an example - I don't really write regions like this)
B4X:
#Region Main
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
#Region ShowMainform
MainForm.Show
#End Region
End Sub
#End Region