Sample Code Browses Fields and Accesses Scroll Bar

Last reviewed: April 29, 1996
Article ID: Q88665
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6

This article contains two methods to incorporate a BROWSE command in another window. The first option does not allow data entry; the second option does.

Method 1

The following sample code allows you to move through the browse fields and have access to a scroll bar, but does not allow you to modify the database or close the Browse window without closing the parent window.

The program assumes you have a database named TEST.

   USE Test
   DEFINE WINDOW Parent FROM 1,1 TO 15,25 SYSTEM
   ACTIVATE WINDOW Parent
   BROWSE NOEDIT NOAPPEND NODELETE ;
   WINDOW Parent
   IF LASTKEY()=27
      DEACTIVATE WINDOW PARENT
   ENDIF

Method 2

The following sample code accomplishes the same result but does not limit your ability to enter data. In the MS-DOS environment, the size parameters should be made smaller, or the following command should be issued first:

   SET DISPLAY TO VGA50

   USE Test
   DEFINE WINDOW Parent FROM 1,1 TO 30,45 SYSTEM
   ACTIVATE WINDOW Parent
   DEFINE WINDOW Child from 2,2 SIZE 26,37 IN WINDOW Parent
   BROWSE IN WINDOW Parent WINDOW Child NOWAIT

REFERENCES

"Creating FoxPro Applications," George F. Goley IV, Que Corporation, 1993, page 244


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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.