Screen Class

Used to get information about the monitors connected to the user's computer.

Events

None

Properties

AvailableHeight

Height

AvailableLeft

Left

AvailableTop

Top

AvailableWidth

Width

Depth

 

Methods

None

More information available in parent classes: Object


Notes

Although you cannot create an object of type Screen, you can access screen objects through the Screen function. See the Screen and ScreenCount functions for more information.


Example

The following reports on the values of AvailableLeft, AvailableHeight, AvailableTop, and AvailableWidth for the main screen. If the user has the Hide the Dock option on, the size of the dock when it is temporarily made visible is not taken into account.

Dim s as String
s="Left="+ Str( Screen(0).availableleft)+ Chr(13)
s=s+"Width="+ Str( Screen(0).availablewidth)+ Chr(13)
s=s+"Top="+ Str( Screen(0).availabletop)+ Chr(13)
s=s+"Height="+ Str( Screen(0).availableheight)+ Chr(13)
Me.text=s

The following example reports on the characteristics of the user's main screen. The code is placed in the Open event of a window and displays its results in a series of EditFields in the window.

HeightField.text= Str( Screen(0).height)
WidthField.text= Str( Screen(0).width)
AvailableHeightField.text= Str( Screen(0).availableHeight)
AvailableWidthField.text= Str( Screen(0).availablewidth)
AvailableTopField.text= Str( Screen(0).availableTop)
AvailableLeftField.text= Str( Screen(0).availableLeft)
DepthField.text=Str( Screen(0).depth)

See Also

Screen, ScreenCount functions.