Dim PageButtonSettings As ButtonSettings
Dim PageProgAndScan As ProgAndScan
Sub TrayIcon1_DoubleClick
Log("Double Click")
MaximizeForm(B4XPages.GetNativeParent(Me).As(Form)) ' If already maximized nothing happen
MaximizeForm(B4XPages.GetNativeParent(PageProgAndScan).As(Form)) ' If already maximized nothing happen
End Sub
Public Sub MaximizeForm(Frm As Form)
Dim jForm As JavaObject = Frm
Dim stage As JavaObject = jForm.GetField("stage")
stage.RunMethod("setIconified", Array As Object(False))
End Sub
Public Sub MinimizeForm(Frm As Form)
Dim jForm As JavaObject = Frm
Dim stage As JavaObject = jForm.GetField("stage")
stage.RunMethod("setIconified", Array As Object(True))
End Sub
Sub TrayIcon1_MenuClick (txt As String)
Select txt
Case "Disattiva"
TrayIcon1.SetImage(BlueImage)
isActive = False
Case "Attiva"
isActive = True
TrayIcon1.SetImage(GreenImage)
Case "Esci"
ExitApplication
End Select
End Sub