Bug? Screen object initialize

stevel05

Expert
Licensed User
Longtime User
I tried to get the screen size from the screen object,

Code: Copy
Dim S As Screen
Log(S.MinX&","&S.MinY&","&S.MaxX&","&S.MaxY)

but just get an error that says
Object should first be initialized (screen)

There is no initialize method for Screen.
 
Ok, I got it. It needs to be used in conjunction with fx.screens.

Code: Copy
Dim SList As List = fx.Screens
For Each S As Screen In SList
    Log(S.MinX&","&S.MinY&","&S.MaxX&","&S.MaxY)
Next

Or static calls to Screen via reflection
 
Last edited:
I was thinking more of using Screen.getScreensForRectangle to work out which monitor the app was currently on and the best place to open a new window when necessary.
 
Back
Top