Partager via


ZOOM WINDOW Command

Changes the size and position of a user-defined window or a Visual FoxPro system window.

ZOOM WINDOW WindowName MIN | MAX | NORM
   [AT nRow1, nColumn1 | FROM AT nRow1, nColumn1
   [SIZE AT nRow2, nColumn2 | TO nRow2, nColumn2]]

Parameters

  • WindowName
    Specifies the name of the window whose size you want to change.

  • MIN
    Reduces the window to minimum size.

    In Visual FoxPro for Windows, the window is reduced to an icon.

    All system windows can be reduced to a minimum size in Visual FoxPro for Windows. Visual FoxPro system windows must be open in the main Visual FoxPro window or a user-defined window before they can be minimized.

    A user-defined window can be minimized after it is defined. It doesn't have to be activated before you change its size.

  • MAX
    Expands a window to fill the main Visual FoxPro window, the Windows desktop, or a user-defined window. If a child window is placed in a parent window and the child window is maximized, it fills the parent window. If any of the additional ZOOM WINDOW clauses (AT, SIZE, TO, or FROM) are included with MAX, MAX is ignored.

    Only user-defined windows defined with ZOOM can be expanded to maximum size.

  • NORM
    Returns a window to its original size after it has been minimized or maximized. NORM can also be used to move a window without changing its size. Use ZOOM WINDOW NORM without any additional clauses to return a minimized or maximized window to its original size and location.

  • AT nRow1, nColumn1 | FROM nRow2, nColumn2
    You can specify the placement of a window by including the AT or FROM clause.

    ZOOM WINDOW WindowName NORM AT AT nRow1, nColumn1 restores a minimized or maximized window to its original size and places it at the specific location. The AT nRow1, nColumn1 coordinates specify where the upper-left corner of the window is placed. A window's location can also be changed with MOVE WINDOW.

    In Visual FoxPro for Windows, if NORM is included, the upper-left corner of the window is placed in the main Visual FoxPro window at the location specified with AT nRow1, nColumn1. If MIN is included, AT and FROM are ignored and the window is displayed as an icon in the lower portion of the main Visual FoxPro window. If MAX is included, AT and FROM are ignored and the window is expanded to fill the main Visual FoxPro window.

    In Visual FoxPro for Windows, if the window is created with the IN DESKTOP clause, the upper-left corner of the window is placed in the Windows desktop at the location specified with AT nRow1, nColumn1. If MIN is included, AT and FROM are ignored and the window is displayed as an icon in the lower portion of the Windows desktop. If MAX is included, AT and FROM are ignored and the window is expanded to fill the Windows desktop.

  • SIZE AT nRow2, nColumn2 | TO nRow2, nColumn2
    You can also specify a window size for a window by including SIZE or TO. If SIZE is included, the window size is nRow2 rows high and nColumn2 columns wide. If the TO clause is included, the upper-left corner of the window remains in its current position and the lower-right corner of the window is placed at the position specified with nRow2, nColumn2.

Remarks

In Visual FoxPro for Windows, windows can be reduced to a minimum size, enlarged to fill the entire main Visual FoxPro window, or sized anywhere in between.

If you create a user-defined window with DEFINE WINDOW and the IN DESKTOP clause in Visual FoxPro for Windows, the window you create can be enlarged to fill the entire desktop.

In Visual FoxPro for Windows, windows can be zoomed directly from minimum to maximum size and vice versa.

When zooming a window, you can specify where to place the resized window in the main Visual FoxPro window or a user-defined window.

To zoom a system window, enclose the entire system window name in quotation marks. For example, to maximize the Command window, issue the following command:

ZOOM WINDOW 'Command Window' MAX

You can use ZOOM WINDOW to resize all system windows.

Example

In the following example, a Browse window is opened for the customer table. The Browse window is minimized. The Browse window is then returned to its default size. It is then minimized again at a specific location. The Browse window is then enlarged to a specific size and is maximized.

CLEAR ALL
CLEAR
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\Testdata')
USE customer  && Opens Customer table
BROWSE NORMAL NOWAIT

IF _DOS OR _WINDOWS
   ZOOM WINDOW customer MIN
   WAIT WINDOW TIMEOUT 3 ;
      'MIN clause - This window will timeout. Please wait.'
ENDIF

ZOOM WINDOW customer NORM
WAIT WINDOW TIMEOUT 3 ;
   'NORM clause - This window will timeout. Please wait.'

IF _DOS OR _WINDOWS
   ZOOM WINDOW customer MIN AT 10,10
   WAIT WINDOW TIMEOUT 3 ;
      'MIN AT 10,10 clause - This window will timeout. Please wait.'
ENDIF

ZOOM WINDOW customer NORM AT 1,1 SIZE 22,25
WAIT WINDOW TIMEOUT 3 ;
   'NORM & SIZE clauses - This window will timeout. Please wait.'
ZOOM WINDOW customer NORM FROM 10,10 TO 22,70
WAIT WINDOW TIMEOUT 3 ;
   'NORM & TO clauses - This window will timeout. Please wait.'
ZOOM WINDOW customer MAX
WAIT WINDOW TIMEOUT 3 'MAX clause - This window will timeout. Please wait.'
CLEAR ALL

See Also

ACTIVATE WINDOW | DEFINE WINDOW | SIZE WINDOW