### Set Form Stage Mode

Example Subs to set the Form Stage Mode Full Screen, Fill Screen, Iconized, Minimized, Maximized.
Reference: http://docs.oracle.com/javase/8/javafx/api/javafx/stage/Stage.html
'Sets a form to full screen undecorated window - use ESC to leave the fullscreen mode.
`Sub SetFormFullScreen(frm As Form)
'Create a new JavaObject and assign the form
Dim joForm As JavaObject = frm
'Get the stage field from the form
Dim joStage As JavaObject = joForm.GetField("stage")
'Apply the API method setFullScreen to the stage which is bind to the form
joStage.RunMethod("setFullScreen", Array(True))
Log("Fullscreen set")
End Sub`
`Sub SetFormMaximized(frm As Form)
'Create a new JavaObject and assign the form
Dim joForm As JavaObject = frm
'Get the stage field from the form
Dim joStage As JavaObject = joForm.GetField("stage")
'Apply the API method setFullScreen to the stage which is bind to the form
joStage.RunMethod("setMaximized", Array(True))
Log("Maximized set")
End Sub`
`Sub SetFormIconified(frm As Form)
'Create a new JavaObject and assign the form
Dim joForm As JavaObject = frm
'Get the stage field from the form
Dim joStage As JavaObject = joForm.GetField("stage")
'Apply the API method setFullScreen to the stage which is bind to the form
joStage.RunMethod("setIconified", Array(True))
Log("Iconified set")
End Sub`
'Centers a form on the primary screen
`Sub SetFormCenterOnScreen(Frm As Form)
Dim ps As Screen = fx.PrimaryScreen
Frm.WindowTop = (ps.MaxY - ps.MinY) / 2 - Frm.Height / 2
Frm.WindowLeft = (ps.MaxX - ps.MinX) / 2 - Frm.Width / 2
End Sub`
'Set the form to fill the screen
`Sub setFormFillScreen(frm As Form)
Dim ps As Screen = fx.PrimaryScreen
frm.WindowLeft = ps.MinX
frm.WindowWidth = ps.MaxX - ps.MinX
frm.WindowTop = ps.MinY
frm.WindowHeight = ps.MaxY - ps.MinY
End Sub`

Changed: , Category: Forms, File: T6C195M1434.htm, ID: 1434