DesktopDisplay.DisplayCount
From Xojo Documentation
Read-Only Property (As Integer )
IntegerValue = aDesktopDisplay.DisplayCount
New in 2021r3
Supported for all project types and targets.
New in 2021r3
Supported for all project types and targets.
Used to determine the number of displays connected to the user’s computer.
Syntax
result=ScreenCount
Part | Type | Description |
---|---|---|
result | Integer | Any container expecting an Integer value. |
Notes
The DisplayCount function returns the number of displays (monitors) connected to the user's computer (Windows and Macintosh). On Linux, DisplayCount always returns 1.
Examples
This example reports on the number of monitors attached to the user's computer.
Var myDisplays As Integer
myDisplays = DesktopDisplay.DisplayCount
If myDisplays = 1 Then
MessageBox("You have only one display.")
Else
MessageBox("You have " + myDisplays.ToString + " displays!")
End If
myDisplays = DesktopDisplay.DisplayCount
If myDisplays = 1 Then
MessageBox("You have only one display.")
Else
MessageBox("You have " + myDisplays.ToString + " displays!")
End If
See Also
DesktopDisplay class; DesktopDisplay.DisplayAt function.