JavaScript Editor js editor     Web development 

Main Page

Specifies properties and methods for the main Visual FoxPro window. You can use _SCREEN to manipulate the main Visual FoxPro window as an object. There are two versions of the syntax.

_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.


You cannot create events procedures for _SCREEN. However, you can use the BINDEVENT(В ) Function to bind _SCREEN events to other object events and methods. _SCREEN is an object type system variable.

In versions of Visual FoxPro 7.0 and later, the Top, Height, Left, Width, and hWnd properties of _SCREEN apply only to the Visual FoxPro client area, which is the area that can display text. In versions prior to Visual FoxPro 7.0, the Top and Left properties reference the entire Visual FoxPro application window.

CLEAR WINDOWS or RELEASE WINDOWS sets the ReleaseType property for _SCREEN to 1. Closing the Windows operating system sets ReleaseType to 2. For more information, see CLEAR Commands and RELEASE WINDOWS Command.

The value returned by ReleaseType for _SCREEN can differ from the value returned by ReleaseType for 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:

В Copy Code
Local oldScreenLeft
Local oldScreenTop
Local oldScreenHeight
Local oldScreenWidth
Local oldScreenColor

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

В Copy Code
 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:

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

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

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

See Also

JavaScript Editor js editor     Web development