Question on Active Form

HARRY

Active Member
Licensed User
Longtime User
Hi,

In a program I have 9 forms. The program runs in landscape mode. If the program is interrupted by an user action or an incoming mail or telephone call, the 'interruptor' may change the screen orientation. When the interruptor ends, my program gets control again , but the screen orientation may be portrait.

Therefore, I introduced the activate event to check the screen orientation. If necessary I reorientate the screen and now I have to refresh the form, which is activated on return.

Does a possibility exist to find out which form is active and should be refreshed?

Something like Screen.ActiveForm.Refresh as in VB or another solution

Harry
 

sitajony

Active Member
Licensed User
You can do it with Formlib.dll:

fl=FormLib
B4X:
Sub fl_Resize
    if Form1.Width<Form1.Height Then 'Portrait
        'Rotate screen.
    End If
End Sub

fl_Resize run when the screen change orientation...

Good Luck

Edit: I didn't see the end of your POST sorry:
You can also set a variable:
B4X:
activeform=0
Sub Form1_Show
    activeform=1
End Sub
Sub Form2_Show
    activeform=2
End Sub
Sub Form3_Show
    activeform=3
End Sub
'....
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…