Compartilhar via


Visual Basic Concepts

Customizing Areas of the Hierarchical FlexGrid

The Hierarchical FlexGrid contains different areas that you can customize. You can customize these areas using the Hierarchical FlexGrid's Property Pages dialog box****or programmatically, using the Code Editor window. Customization of the areas can enhance readability and increase the usefulness of your Hierarchical FlexGrid.

The areas of the Hierarchical FlexGrid include:

  • Standard

    The standard area of your Hierarchical FlexGrid is the cells that contain data-bound information.

  • Band

    The band area contains display information for each Recordset within your Hierarchical FlexGrid. See Formatting a Band for more information.

  • Fixed

    The fixed area consists of rows and columns that are fixed, or static.

  • Header

    The column header area identifies information about the Recordset that is bound to your Hierarchical FlexGrid. When used, column headers repeat for each band in your Hierarchical FlexGrid. See Formatting a Band for more information.

  • Indent

    When displaying bands vertically, the indent area of your Hierarchical FlexGrid is the area that indents a band of data by a specified number of columns. The indented column before each band contains empty, non-working cells. See Formatting a Band for more information.

  • Unpopulated

    The unpopulated area of your Hierarchical FlexGrid contains the cells to the right and below the working areas of your Hierarchical FlexGrid. This area is empty and contains non-working cells.

Customizing Standard Appearance

You can customize the appearance of the standard area of your Hierarchical FlexGrid, making information more clear and accessible. The standard area contains the cells that are bound to data.

To customize the appearance of the standard area of a Hierarchical FlexGrid

  1. Right-click your Hierarchical FlexGrid, and select Properties from the shortcut menu. The Hierarchical FlexGrid's Property Pages dialog box****appears.

  2. On the General tab, set the following standard properties:

Property Description
Rows Number of rows in the Hierarchical FlexGrid.
Columns Number of columns in the Hierarchical FlexGrid.
AllowBigSelection Enables the user to select an entire column or row within the Hierarchical FlexGrid by clicking on a column or row header.
MousePointer Determines the type of mouse pointer.

Note   To use a custom mouse pointer, you must assign a custom icon to the MouseIcon property from the Picture tab.

FillStyle Determines whether text and cell formatting should apply to a single cell or all selected cells.
SelectionMode Determines how your Hierarchical FlexGrid will allow selection by the user.
AllowUserResizing Determines whether the user is allowed to resize rows and columns using the mouse.
ScrollBars Determines whether the Hierarchical FlexGrid has a scrollbar, and if so, whether this is horizontal or vertical, or both.
HighLight Determines when cells should receive emphasis.
FocusRect Defines the type of focus rectangle that your Hierarchical FlexGrid draws around the current cell.
3. On the **Style** tab, set the following standard properties:
Property Description
MergeCells Whether cells with identical contents are grouped into a single cell spanning multiple cells or rows.
RowHeightMin A minimum row height for the entire control, in .
PictureType Whether a picture displays in color or monochrome.
WordWrap Whether your Hierarchical FlexGrid allows text within a cell to wrap or have multiple lines.
4. On the **Font** tab, set the following standard properties:
Property Description
Font The name of the font style.
Size The size of the font, in points.
Effects The text effect: underline or strikeout, or the text style: bold or italic. You can select up to four Effects check boxes.
Sample Text A preview of the font selection.
5. Click **OK** to apply the standard properties to your Hierarchical FlexGrid and close the **Property Pages** dialog box.

Customizing Fixed Appearance

You can create fixed rows or columns to display in your Hierarchical FlexGrid. To increase readability, you should use a fixed area to display one heading set instead of using repeating column headers for each band. This area remains static, identifying the rows, below, or columns, to its right.

To customize the appearance of the fixed area of a Hierarchical FlexGrid

  1. Right-click your Hierarchical FlexGrid, and select Properties from the shortcut menu. The Hierarchical FlexGrid's Property Pages dialog box appears.

  2. On the General tab, specify the number of fixed rows and columns in the Fixed Rows and Fixed Cols text boxes, and then click Apply.

  3. On the Style tab, select the style for the fixed text from the TextStyleFixed box, and then click Apply.

  4. On the Font tab, set the following standard properties:

Property Description
Font The name of the font style.
Size The size of the font, in points.
Effects The text effect: underline or strikeout, or the text style: bold or italic. You can select up to four Effects check boxes.
Sample Text A preview of the font selection.
  1. From the Color tab, assign each fixed property a color. To do this, first select a Color Set. Next, click the property you wish to change (for example, BackColorFixed), click a color in the Color Palette, and then click Apply. Repeat this for each fixed area that you wish to change.

    Note   When using Windows Default colors, the Hierarchical FlexGrid appears in the colors specified in the your system's Display Control Panel. In addition to changing Hierarchical FlexGrid color properties to a standard or Windows default color, you can create your own color definitions by clicking Edit Custom Color and using the resulting Color dialog box. For information on each property, see the Hierarchical FlexGrid's property topics.

  2. Click OK to apply the fixed properties to your Hierarchical FlexGrid and close the Property Pages dialog box.

Customizing Header Appearance

You can change the formatting and display properties of the band header in your Hierarchical FlexGrid.

To customize the header appearance of a Hierarchical FlexGrid

  1. Right-click your Hierarchical FlexGrid, and then select Properties from the shortcut menu. The Hierarchical FlexGrid's Property Pages dialog box appears.

  2. On the Bands tab, select a heading style from the TextStyleHeader box, and then select ColumnHeaders.

    Note   To prevent your Hierarchical FlexGrid from displaying duplicate headings, you must set the Fixed Row text box, from the General tab, to 0. In addition, if you want to display only one set of headers for a band at the top of the Hierarchical FlexGrid, fixed rows must be used instead of column headers.

  3. In the Column Caption and Column Name list boxes, specify the columns to display. By default, this list includes all the fields in the Recordset with their field name. To remove a Field object from the display or to change its name, use the Column Caption list. To deselect a field, click the corresponding check mark. To change its name, click the name to select it, then click it again to access edit mode to rename it.

  4. Click OK to apply the band properties to your Hierarchical FlexGrid and close the Property Pages dialog box.

Customizing Unpopulated Areas

You can change the formatting and display properties of the unpopulated area of your Hierarchical FlexGrid. This unpopulated area is empty and contains no data.

To customize the appearance of the unpopulated area of the Hierarchical FlexGrid

  1. Right-click your Hierarchical FlexGrid, and then select Properties from the shortcut menu. The Hierarchical FlexGrid's Property Pages dialog box appears.

  2. On the Style tab, change the GridLinesUnpopulated property.

  3. On the Color tab, assign each fixed property a color. To do this, first select a Color Set. Next, click the property to change (for example, BackColorUnpopulated), click a color in the Color Palette, and then click Apply. Repeat this for each unpopulated area that you wish to change.

    Note   When using Windows Default colors, the Hierarchical FlexGrid appears in the colors specified in the your Display Control Panel. In addition to changing Hierarchical FlexGrid colors properties to a standard or Windows default color, you can create your own color definitions by clicking Edit Custom Color and using the resulting Color dialog box.

  4. Click OK to apply the fixed properties to your Hierarchical FlexGrid and close the Property Pages dialog box.