Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual FoxPro
Expertise: Beginner
Oct 6, 2000

Maximizing the Browse Window

Question:
When I use the BROWSE command it always displays the results in a normal window. Is there a command to maximize the browse window in the program?

Answer:
The simplest way to accomplish this, is not to use the BROWSE command at all. Drop a grid onto a form instead. You could then use the form designer to set the windowstate property of the form to 2, which tells VFP to maximize the window.

Here are two approaches you could take if you would rather use a browse window. First (and simplest) would be to stuff the keyboard buffer with Ctrl+F10. This key sequence tells the active window to maximize. You could do the following:

KEYBOARD "{CTRL+F10}" PLAIN 
BROWSE
The second approach is to use the DEFINE WINDOW command to accomplish what you need. This command allows you to create a window and size it. You can then take advantage of the WINDOW clause of the BROWSE command to make the browse occur in the window you have created. Drop the following code into a PRG file and run it.
USE MyTable

*-- Create a window to show the browse in, 
*-- and create an object reference to
*-- the window called oBrowse

DEFINE WINDOW MyBrowseWindow ;
  FROM 1, 1 TO 2,2 ;
  NAME oBrowse ;
  TITLE "My Browse Window" ;
  DOUBLE ;
  CLOSE ;
  FLOAT ;
  GROW ;
  MINIMIZE ;
  ZOOM 

*-- Set the windowstate of the 
*-- browse window to be maximized
oBrowse.WindowState=2

*-- Activate the window and show the
*-- browse in it
ACTIVATE WINDOW MyBrowseWindow
BROWSE WINDOW MyBrowseWindow

*-- release the window
RELE WINDOW MyBrowseWindow
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap