Cableguy Expert Licensed User Longtime User Sep 11, 2015 #1 Hi Guys How can I manage the top-right options? (Minimize, Maximize/Restore, Close) I'm using the code snippet in B4J How-To's to make my app full screen, BUT it's not the same as setting it to Maximize. How can I manage those states? I found how to Maximize a Form: Code: Copy Sub SetMaximized(frm As Form) Dim joForm As JavaObject = frm Dim joStage As JavaObject = joForm.GetField("stage") joStage.RunMethod("setMaximized", Array(True)) End Sub But how to catch those events to act upon? like screensize_changed kinda of event Last edited: Sep 11, 2015
Hi Guys How can I manage the top-right options? (Minimize, Maximize/Restore, Close) I'm using the code snippet in B4J How-To's to make my app full screen, BUT it's not the same as setting it to Maximize. How can I manage those states? I found how to Maximize a Form: Code: Copy Sub SetMaximized(frm As Form) Dim joForm As JavaObject = frm Dim joStage As JavaObject = joForm.GetField("stage") joStage.RunMethod("setMaximized", Array(True)) End Sub But how to catch those events to act upon? like screensize_changed kinda of event
R Roycefer Well-Known Member Licensed User Longtime User Sep 11, 2015 #2 Forms have a _Closed and a _CloseRequested() event. For Maximize and Unmaximize, you can use the AnchorPane's _Resize event. Forms also have a _FocusChanged event that you can use to help detect Minimize though they also fire when focus is merely taken out of the Form and the Form isn't minimized. As for making the Form truly Maximized, this code should set you in the right direction: Code: Copy Dim mf As JavaObject = MainForm mf.GetFieldJO("stage").RunMethod("setFullScreen", Array(True)) Upvote 0
Forms have a _Closed and a _CloseRequested() event. For Maximize and Unmaximize, you can use the AnchorPane's _Resize event. Forms also have a _FocusChanged event that you can use to help detect Minimize though they also fire when focus is merely taken out of the Form and the Form isn't minimized. As for making the Form truly Maximized, this code should set you in the right direction: Code: Copy Dim mf As JavaObject = MainForm mf.GetFieldJO("stage").RunMethod("setFullScreen", Array(True))
Cableguy Expert Licensed User Longtime User Sep 11, 2015 #3 FullScreen is not exactly what I need, simply because it hides all the decorations and system tray. I was under the impression that an anchorpane is yet another "view"...?? Upvote 0
FullScreen is not exactly what I need, simply because it hides all the decorations and system tray. I was under the impression that an anchorpane is yet another "view"...??
Erel B4X founder Staff member Licensed User Longtime User Sep 11, 2015 #4 You should handle MainForm_Resize event: Code: Copy Sub MainForm_Resize (Width As Double, Height As Double) End Sub Upvote 0
You should handle MainForm_Resize event: Code: Copy Sub MainForm_Resize (Width As Double, Height As Double) End Sub
R Roycefer Well-Known Member Licensed User Longtime User Oct 18, 2015 #5 In case anyone is still interested, this maximizes the MainForm without hiding the decorations and system tray: Code: Copy Dim mf As JavaObject = MainForm mf.GetFieldJO("stage").RunMethod("setMaximized", Array(True)) Upvote 0
In case anyone is still interested, this maximizes the MainForm without hiding the decorations and system tray: Code: Copy Dim mf As JavaObject = MainForm mf.GetFieldJO("stage").RunMethod("setMaximized", Array(True))