_SCREEN System Variable

Visual Studio .NET 2003

Specifies properties and methods for the main Visual FoxPro window.

_SCREEN.PropertyName [= eValue]




Specifies a property for the main Visual FoxPro window.
Specifies a value for the property.
Specifies a method to execute for the main Visual FoxPro window.


_SCREEN allows the main Visual FoxPro window to be manipulated as an object. Events procedures cannot be created for _SCREEN. _SCREEN is an object type system variable.

Beginning with Visual FoxPro 7, the Top, Height, Left, Width, and hWnd properties of _SCREEN apply only to the Visual FoxPro client area (the area where text can be displayed). In prior versions, the Top and Left properties referenced the entire Visual FoxPro application window. CLEAR WINDOWS or RELEASE WINDOWS also sets ReleaseType to 1. Closing the Windows Operating System will set ReleaseType to 2.

Note   The value returned by _SCREEN.ReleaseType can differ from the value returned by other forms because it is the main Visual FoxPro window.


The following example demonstrates the use of _SCREEN to customize the main Visual FoxPro window. The following lines of code declare local variables for storing the current settings:

Local oldScreenLeft
Local oldScreenTop
Local oldScreenHeight
Local oldScreenWidth
Local oldScreenColor

The following code saves the current settings of the main Visual FoxPro window:

 oldScreenColor = .Backcolor

The following codes disable redrawing of the window, change the background color to grey, changes the border style, sets properties for the window's control buttons, makes the window movable at run time, specifies the height and width of the window, sets a caption for the window, and enables redrawing of the screen:

 .Caption="Custom Screen"    
=MESSAGEBOX("Return to normal  ",48,WTITLE())

The following code sets the properties of the window to its original settings:

 .Left = oldScreenLeft     
 .Top = oldScreenTop       
 .Height = oldScreenHeight
 .Width  = oldScreenWidth
 .Caption="Microsoft Visual FoxPro"  

See Also

_SCREEN System Variable Properties, Methods and Events | MODIFY WINDOW | Form Object