Partager via


Customizing Forms

You can add enhancements to your forms to make them more interesting visually and easier to use. For example, you might want to group similar controls together visually by drawing a box around them, or use images to give the forms a more professional appearance.

Using the Form Designer, you can customize your forms by:

  • Changing text fonts and sizes
  • Adding shapes and lines to a form
  • Adding graphics to a form
  • Setting the foreground and background colors of a form

Changing Text Fonts and Sizes

Using the font properties in the Properties window, you can modify the style and size of the text that appears in controls you have added to your forms. You can choose from the available font styles and sizes supported by your system. To change the text in your form, change the font properties, such as FontName, FontSize, and FontBold, shown in the Properties window.

To change the text in your forms

  1. In the Form Designer, select the control you want to change.
  2. In the Properties window, drop down the Object list, and select the object you want to change.
  3. Locate the font property you want to change, and set its value.

Adding Shapes and Lines to Forms

You can add shapes and lines to forms to customize them. For example, you may want to separate groups of controls with a dividing line, or enclose related controls within a box to set them apart.

To add a line to a form

  1. In the Form Controls toolbar, choose the Line button.
  2. Drag in the form to create a line.

You can size and move the line like other controls, or change the slant of the line with the LineSlant property in the Properties window.

To add a shape to a form

  1. In the Form Controls toolbar, choose the Shape button.
  2. Drag in the form to create a shape.

You can change the type of shape drawn with the Curvature property in the Properties window.

Adding Graphics to a Form

You can add an image to the background of your form, or add an image to a box inside the form.

To add a graphic to your form

  1. Choose one of the following:
    • To change the background of the form, select the form.

      -or-

    • To add a picture to your form, select an Image control from the Form Controls toolbar and place it on the form.

  2. In the Properties window, select the Picture property.
  3. Choose the dialog button to display the Open dialog box.
  4. Locate the image or other file you want to use.
  5. Choose OK.

Setting Form Colors

You can control a form's colors by using the ColorSource property to base the colors on an existing color scheme, or you can use the Color Palette toolbar to change the foreground or background color of your forms and the controls within them.

To set form colors using the ColorSource property

  • On the Layout tab in the Properties window, choose ColorSource and select a value.

To set the foreground or background color of a form or control

  1. From the View menu, select Color Palette toolbar.
  2. Choose Foreground Color or Background Color.
  3. Select the control or form you want to change.
  4. In the Color Palette toolbar, select the color you want to use.
  5. To see more color choices, choose Other Colors on the toolbar.

To create a custom color

  1. In the Color Palette toolbar, choose Other Colors.

  2. In the Color dialog box, choose Define Custom Colors to display the Custom Color Selector.

  3. Select one of the Custom Colors boxes, and then click in the Custom Color Selector to select the custom color you want.

  4. Choose Add to Custom Colors to add the new color to your palette.

  5. Choose OK.

    Visual FoxPro applies the custom color to the current selection.

See Also

Creating Forms | Form Designer | Properties window | ColorSource property | Creating Forms | Setting the Design Area for a Form | Managing Multiple Instances of a Form | LineSlant Property