B4J Question B4XPages and form SetOwner

Num3

Active Member
Licensed User
Longtime User
Hi all,
I have searched the forums but didn't find a answer for this. I am trying to force a child b4xpage to be owned by the master page, so that master window (page) is disabled until the child is closed.
I have tried this code, but the master page is not disabled.

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("wregistomanut")
   
    Dim form As Form = B4XPages.GetNativeParent(Me)      
    form.SetFormStyle("UNIFIED")
    form.WindowWidth = 455dip
    form.WindowHeight = 210dip
    form.Icon = fx.LoadImage(File.DirAssets, "icon.png")
    form.AlwaysOnTop = True
    form.Resizable = False
   
    ' ***** THIS LINE HERE ****
    form.SetOwner(B4XPages.GetNativeParent(B4XPages.MainPage.wMain))
    ' *************************
End Sub

Am i missing something? Is it even possible to do it with B4XPages ?
 

Num3

Active Member
Licensed User
Longtime User
Nevermind...
Too many hours coding and too little coffee, I answer myself now:

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("wregistomanut")
    
    Dim form As Form = B4XPages.GetNativeParent(Me)   
    'form.SetOwner(B4XPages.GetNativeParent(B4XPages.MainPage.wMain))
    
    form.SetFormStyle("UNIFIED")
    form.WindowWidth = 455dip
    form.WindowHeight = 210dip
    form.Icon = fx.LoadImage(File.DirAssets, "icon.png")
    form.AlwaysOnTop = True
    form.Resizable = False
    
    form.ShowAndWait '<--------------------------------

End Sub
 
Upvote 0
Top