FoxPro for Windows Power Tool Tips and Tricks

Last reviewed: April 30, 1996
Article ID: Q119155
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.6

SUMMARY

This information is also available in FoxPro's online help system.

To go directly to this topic, choose the "Tips and Tricks" help topic. Then do one of the following, depending on which online help file is in use:

  • FOXHELP.HLP: Choose the "Power Tool Tips" jump text.
  • FOXHELP.DBF: Scroll to the "Power Tool Tips" heading.

MORE INFORMATION

Invisible Buttons in Screens

Invisible buttons are a type of push button and can be created using the push button tool in the Screen Builder toolbox.

Pictures Buttons in Screens

You can create picture screen controls such as push buttons, check boxes and radio buttons using the SHOW GET command. In addition, you can specify a separate .BMP file for each of the three states in which a control can exist (enabled, selected, disable) as shown in this example:

   SHOW GET mybtn,7  PROMPT 'EXITEN.BMP,EXITSEL.BMP,EXITDIS.BMP'

Automatic Color for Screen Objects

If you intend to allow users to set their own colors in applications, make sure that screen objects use the Automatic color setting from the Screen menu color palettes.

Bitmaps for Screen Controls

When using bitmaps in a set of controls, try to use bitmaps that are the same size. You should also use bitmaps that have a white (distinguishing) background so that when you disable them, they will have a well defined outline. Try to use a bitmap that is slightly smaller than the overall control because extra border space is added automatically.

Three-Dimensional Screens

You can create dialogs which appear three-dimensional, making objects look like they are recessed into the screen. To create this effect, change the color of the screen to light gray. Next, use the line tool to make a box for the area you want to recede or bring out. Finally, change the pen color of one set of adjacent lines to white and the other to black. Coloring the top line white makes the screen section appear to come out at you. Using white on the bottom gives a recessed appearance. Try to use a small pen size for the best effect.

Spinner Limits

When creating spinners, remember that the minimum and maximum settings do not stop a user from typing in any value they desire. You must specify range values to limit the values that users can type.

Override Snap to Grid

The Snap To Grid option in the Screen Builder allows you to align objects to a grid defined in the Ruler/Grid dialog. To override the Snap To Grid setting, hold down the CTRL key when moving an object. If you are not sure whether objects are aligned, use the line tool to create a temporary line for alignment purposes. Also, you can use the Show Position menu option to display the exact coordinates of an object in the status bar.

Single Platform Screens

If you are generating screens for use in Windows only, make sure you have the Window Objects Only option checked in the Generate Screen dialog. This will reduce the amount of code generated and the time it takes to generate code.

Transparent/Opaque Screen Objects

The Screen Builder allows you to apply a Mode attribute to certain objects such as text. The Mode attribute can be opaque or transparent. A text object's fill colors only appear if the object is opaque. Avoid using a transparent mode on @ ... SAYs which are refreshed with different text. This will cause the old text to be overwritten on top by the new text.

Since new objects can overwrite old objects, you may not see the desired effect when creating transparent objects that toggle between enabled and disabled states. You can, however, attain some interesting and desired special effects using a transparent mode. For example, a disabled control such as a check box dims the text prompt as well as the box portion of the control. You can make the text prompt appear enabled even though the check box is actually disabled. You simply need to ENABLE and then DISABLE the control using the SHOW GET command.

The SET INTENSITY command can be used to control the background appearance of the @ ... GET fields.

Read-Only Edit Regions in Screens

The @ ... EDIT command is used to create edit regions for memo fields on screens. The Screen Builder does not have an option to make these read- only. You can create a work around solution by defining the WHEN clause of the edit region as an expression and typing in the following code:

   .T. NOMODIFY

Quick Screen

If you create a Quick Screen and you specify a column layout but only get one column, one or more of your fields may be too wide for multiple columns. Adjust the maximum field width in the Quick Screen dialog and try again.

Hot Keys in Screens

In FoxPro for Windows, screen objects are assigned default hot keys. These hot keys can be chosen by pressing ALT+key. This is standard in Microsoft Windows applications.

Templates for Screens and Reports

If you usually use settings in the Screen Builder or Report Writer that are not the default (ruler settings, show position, and so on), consider creating a template with your custom settings and using the template as the base for new screens or reports.

Circles in Screens and Reports

To create a circle (oval) in the Screen Builder or Report Writer, use the rounded-rectangle tool to create the object, then double-click on it and select the round button.

Size Report and Screen Fields

To easily size fields one character at a time, use FONTMETRIC(7) to determine the maximum character width for the font you're using then set the horizontal grid to the maximum character width. When you size fields, they will move one "character" at a time.

Drawing Multiple Objects in Screens and Reports

In the Screen Builder and Report Writer, after you select a tool from the toolbox and draw an object, the selection pointer becomes the active tool. To keep another tool active when drawing multiple objects of the same type, double-click the tool. It will appear darkened when it is selected in this manner.

Special Characters in Reports and Screens

When you add text to a screen or report, you can use any character in the current font, even those characters you can't directly type on the keyboard. To enter special characters, hold down the ALT key and type in the number of the character using the numeric keypad. For example, in ANSI- standard fonts, character number 0169 is the copyright symbol. Character number 0174 is the trademark symbol. Release the ALT key to display the symbol.

Placing Objects in Screens and Reports

In FoxPro for Windows, the keyboard is the best device to use to precisely place objects. When an object is selected, you can use the arrow keys to move it 1 pixel at a time. Holding down the SHIFT key while you use the arrow keys will resize the object.

Multi-Line Text Objects

You can create multi-line text objects in the Screen Builder and Report Writer by pressing ENTER to continue typing on the next line. You are limited to 255 characters per text object.

Redo Quick Screen/Report/Menu

To redo a Quick Screen, Report or Menu, delete all of the objects and choose the Quick Screen/Report/Menu option again.

Managing Snippets

Open and minimize any snippets that are complex or that you use regularly so that when you open the screen or menu, they are easily accessible from the bottom of the main FoxPro window.

Multi-Column Snaking Reports

Because FoxPro for Windows uses the same format for labels as it does for reports, you can create multi-column snaking reports. In fact, the .FRX and .LBX files are identical. And the REPORT FORM and LABEL FORM commands are interchangeable.

AS Clause in RQBE

RQBE does not have a built-in way to create an AS clause to rename an output column. To create an AS clause in RQBE, open the RQBE Select Fields dialog and type the field name followed by the AS name in the Functions/Expression box. This is especially handy when using a function:

   COUNT(people.name) AS 'Employees'

NOTE: When FoxPro reopens a .QPR file, it will ignore the AS clause. It still exists in the file until you save over it. This trick can be quite useful with on-the-fly queries which don't need to be saved.

Right Margin Settings

The Right Margin option in the Print Options dialog is not available in FoxPro for Windows. Instead, use the Print Setup dialog to select the proper paper size.


Additional reference words: FoxWin 2.60 on-line grey multiline
KBCategory: kbprg kbref
KBSubcategory: FxprintFont


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 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.