Screen

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from Object)

Used to get information about the connected displays.

Properties
AvailableHeight fa-lock-32.png ColorDepth fa-lock-32.png Top fa-lock-32.png
AvailableLeft fa-lock-32.png Height fa-lock-32.png Width fa-lock-32.png
AvailableTop fa-lock-32.png Left fa-lock-32.png
AvailableWidth fa-lock-32.png ScaleFactor fa-lock-32.png
Shared Methods
ScreenAt
Shared Properties
LastScreenIndex fa-lock-32.png ScreenCount fa-lock-32.png

Notes

Although you cannot create an object of type Screen, you can access screen objects through the Screen class.

Sample Code

The following reports on the values of AvailableLeft, AvailableHeight, AvailableTop, and AvailableWidth for the main screen. The value of AvailableHeight takes into account the height of the taskbar (Windows and Linux) and the Dock (macOS). If the user has these tools configured to display on the side, the AvailableWidth property takes them into account.

Var s As String
s = "Left=" + Str(Screen.ScreenAt(0).AvailableLeft) + EndOfLine
s = s + "Width=" + Str(Screen.ScreenAt(0).AvailableWidth) + EndOfLine
s = s + "Top=" + Str(Screen.ScreenAt(0).AvailableTop) + EndOfLine
s = s + "Height=" + Str(Screen.ScreenAt(0).AvailableHeight) + EndOfLine
MessageBox(s)