devxlogo

Maximizing the Browse Window

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 oBrowseDEFINE 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 maximizedoBrowse.WindowState=2*-- Activate the window and show the*-- browse in itACTIVATE WINDOW MyBrowseWindowBROWSE WINDOW MyBrowseWindow*-- release the windowRELE WINDOW MyBrowseWindow

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist