Share via


FormatString Property (ModHFGrid)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Sets the column widths, alignments, fixed row text, and fixed column text of the ModHFGrid.

Syntax

object.FormatString [= string]

The FormatString property syntax has these parts:

Part Description
object An object expression that evaluates to the ModHFGrid Control object.
string A string expression for formatting text in rows and columns, as described in Remarks.

Remarks

At design time, the ModHFGrid parses and interprets the FormatString to obtain the following information: number of rows and columns, text for row and column headings, column width, and column alignment.

The FormatString property contains segments separated by pipe characters ( | ). The text between pipes defines a column, and it might contain special alignment characters. These characters align the entire column to the left ( < ), center ( ^ ), or right ( > ). In addition, the text is assigned to row 0 by default, and the text width defines the width of each column.

The FormatString property might contain a semicolon ( ; ). This causes the remainder of the string to be interpreted as row heading and row width information. In addition, the text is assigned to column 0 by default, and the longest string defines the width of column 0.

The ModHFGrid creates additional rows and columns to accommodate all fields defined by the FormatString. Additional rows and columns are not deleted if only a few fields are specified. To remove additional rows and columns, set the Rows and Cols properties.

Example

The following examples illustrate how the FormatString property works.

' Set column headers.
s$ = "<Region |<Product |<Employee |>Sales "
ModHFGrid1.FormatString = s$

Aa190045.deflexgridformatstringpropertyexample1(en-us,office.10).gif

' Set row headers (note semicolon at start)
s$ = ";Name|Address|Telephone|Social Security#"
ModHFGrid1.FormatString = s$

Aa190045.deflexgridformatstringpropertyexample2(en-us,office.10).gif

' Set column and row headers.
s$ = "|Name|Address|Telephone|Social Security#"
s$ = s$ + ";|Robert|Jimmy|Bonzo|John Paul"
ModHFGrid.FormatString = s$

Aa190045.deflexgridformatstringpropertyexample3(en-us,office.10).gif

See Also

ColAlignment, ColAlignmentBand, ColAlignmentHeader Properties (ModHFGrid) | ColWidth Property (ModHFGrid) | ModHFGrid Control