Screen.ScreenCount

From Xojo Documentation

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

Read-Only Property (As Integer )
IntegerValue = aScreen.ScreenCount

New in 2019r2

Supported for all project types and targets.

Used to determine the number of screens connected to the user’s computer.

Syntax

result=ScreenCount

Part Type Description
result Integer Any container expecting an Integer value.

Notes

The ScreenCount function returns the number of screens (monitors) connected to the user's computer (Windows and Macintosh). On Linux, ScreenCount always returns 1.

Examples

This example reports on the number of monitors attached to the user's computer.

Var myScreens As Integer
myScreens = Screen.ScreenCount
If myScreens = 1 Then
MsgBox("You have only one display.")
Else
MsgBox("You have " + Str(myScreens) + " displays!"
End If

See Also

Screen class; Screen.ScreenAt function.