Thanks for the guidance, walt61.
This makes the code simpler and the thinking clearer. I will do this idea when I write the code later.
The window adaptive code I created with your ideas is really well,But I accidentally found a problem, I do not know how to solve, please help guide.
The problem is something like this:
If I put the code into the B4XPage_Appear module, it appears normal when opening the page,But after minimizing the page once, both the Pane and MenuBar will automatically revert to their original location and size.
If the code is put into the B4XPage_Created module, the Pane and MenuBar of the page are the original location and size of the page, without change.
If the code is put into the B4XPage_Appear module, then add the following code to the B4XPage_IconifiedChanged module:
Private Sub B4XPage_IconifiedChanged (Iconified As Boolean)
If Iconified=False Then
If State=0 Then
Resize_Scale(Scale) 'Resize_Scale Is the zoom code module
End If
Else
Resize_Scale(1/Scale)
State=0
End If
End Sub
After the page is minimized several times, the size and position of the page elements deviate too much from the expected distance, and the page is too messy.
Please help me find out the solution to the problem. Thank you very much.