# How to Create a Modal Browse Window

ID: Q121027

2.5x 2.60 2.60a 3.00 | 2.00 2.5x 2.60 2.60a | 2.5x 2.60a | 2.60

    WINDOWS              | MS-DOS               | MACINTOSH  | UNIX

kbprg

The information in this article applies to:

- Microsoft Visual FoxPro for Windows, version 3.0
- Microsoft FoxPro for Windows, versions 2.5x, 2.6, 2.6a
- Microsoft FoxPro for MS-DOS, versions 2.0, 2.5x, 2.6, 2.6a
- Microsoft FoxPro for Macintosh, versions 2.5x, 2.6a
- Microsoft FoxPro for UNIX, version 2.6

## SUMMARY

The window in which a BROWSE is presented is, by default, not a modal window. This means that users can activate other windows while a Browse window is on the screen. In some cases, you may want the Browse window to be modal so that users cannot activate other windows while the Browse window is active. This article explains how to create a modal Browse window.

## MORE INFORMATION

The following sample code produces two Browse windows. The second Browse window will be modal so that users cannot activate any other window.

       * The BROWSE will be terminated when F5 is pressed.
       * Disable the ESC key.

       ON KEY LABEL f5 DO myquit
       ON KEY LABEL esc *

       * Create a sample table for the first BROWSE.

       SELECT 1
       CREATE TABLE one (myfield C(1))
       INSERT INTO one (myfield) VALUES ("A")

       * Display the first Browse window.

       DEFINE WINDOW winone FROM 01,01 TO 10,50
       BROWSE NOWAIT WINDOW winone

       * Create a sample table for the second BROWSE.

       SELECT 2
       CREATE TABLE two (myfield C(1))
       INSERT INTO two (myfield) VALUES ("B")

       * Display the second Browse window.

       DEFINE WINDOW wintwo FROM 11,01 TO 20,50
       BROWSE NOWAIT WINDOW wintwo

       mquit = .F.

       READ MODAL WITH two VALID mquit=.T.

       * This point will be reached when the READ was
       * terminated by pressing the F5 key. Clear the
       * ON KEY LABEL assignments.

       ON KEY LABEL f5
       ON KEY LABEL esc

       RETURN

       PROCEDURE myquit
          mquit = .T.
          CLEAR READ

          * Release the window definitions.

          RELEASE WINDOW winone
          RELEASE WINDOW wintwo

          * Release the Browse windows.

          RELEASE WINDOW one
          RELEASE WINDOW two

          RETURN

Additional reference words: VFoxWin 3.00 FoxUnix FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b 2.50c 2.60 2.60a KBCategory: kbprg KBSubcategory: FxprgBrowse

    Keywords          : FxprgBrowse
    Version           : 2.5x 2.60 2.60a 3.00 | 2.00 2.5x
    Platform          : MACINTOSH MS-DOS UNIX WINDOWS

Last Reviewed: May 1, 1996 © 1999 Microsoft Corporation. All rights reserved. Terms of Use.