Customizing the Grid's Appearance > Captions, Headers, and Footers > Multiple-line headers and footers |
The HeadLines property controls the height of the column headers. By default, it is set to 1, which means that the column headers occupy a single row. If you need to display more than one line of text in a column header, you can increase the HeadLines property to accommodate additional lines, as in the following example:
Example Title |
Copy Code
|
---|---|
With TDBGrid1 .HeadLines = 2 .Columns(0).Caption = "First line" + vbCr + "Second line" End With |
Note the use of the Visual Basic constant vbCr to specify a line break within the caption text. After this code executes, the first column's caption will contain two lines of text, and the second column's caption will be centered vertically.
Similarly, you can set the FootLines property to control the height of column footers, and use the vbCr constant to specify a line break when setting the FooterText property of a column.
Note: The HeadLines property only affects column headers; it has no effect on grid or split captions, which can only occupy a single row.