Creating and applying a background color definition variable

To ensure consistency and "same-look-and-feel" across a variety of forms and components, you can create and apply a set of standard color definition variables for the forms and components in your application. These color definition variables are created and maintained using the Edit Color dialog box. Once created, these background color definition variables are available for use in other forms and components.

Note: 
  • To adjust a color definition variable without affecting the definition itself, apply the variable to the form or component and then adjust it in the form or component property sheet (at which point it becomes a custom or modified definition).
  • This procedure assumes that you already have at least one background color definition variable created and available in the system.

To create and apply a new color definition variable (and add it to a list of existing color definition variables):

  1. Open a form in Design Mode.
  2. On the Form/Collections property sheet, select the Form tab or the component to which you want to apply the background color definition.
  3. In the property sheet Appearance group, select the Background Color property.
  4. In the right margin, click the ellipsis (...) button.
  5. In the Edit Color dialog box, select one of these options:
    • To create a color definition "from scratch", click New.
    • To create a color definition by modifying an existing definition, select the definition from the list and then click Copy.
  6. In the Enter a Name for the Background Color dialog box, specify the name for the new color definition variable.
    Note: When specifying the name, you need not provide the "gbgc_" prefix to the variable name. WinStudio supplies that prefix automatically.
  7. Click OK.
  8. Use the buttons and fields in the Color group box to specify:
    • Style - Color or Linear Gradient.
    • Ext. Color 0 and (if gradient) Ext. Color 1:
      • Basic RGB settings  

        You can use the color picker dialog box to select the color.

      • Alpha (transparency) settings

        You can use either the slider or type a numeric value between 0 and 255 directly in the field.

    • Direction - What direction the gradient should paint, if applicable.
  9. When you have the color definition specified to your satisfaction, click OK.
    Note: Whatever the settings are when you click OK becomes the color definition for this variable. To change the color definition later, open the Edit Color dialog box, adjust the settings, and again click OK. Changing the color definition variable this way does not change previous uses of the variable, only future assignments.

WinStudio immediately applies the color definition to the form background or the designated component. If you do not immediately see the change, you can click elsewhere on the form to refresh the view.

Notice that the Background Color property field displays V(gbgc_variableName), and the Ext. Color attribute fields are populated with the values as specified in the color definition.

Related topics