Microsoft KB Archive/88665

{| = Sample Code Browses Fields and Accesses Scroll Bar =
 * width="100%"|

ID: Q88665

2.00 2.50 2.50a 2.50b 2.60 | 2.50 2.50a 2.50b 2.60 3.00

MS-DOS                    | WINDOWS kbprg 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