Microsoft KB Archive/133164

= How To Define Multiple-Line Grid Headers =

Article ID: 133164

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition

-



This article was previously published under Q133164



SUMMARY
By default, the header object in a Grid does not support multiple-line captions. It is possible, however, to simulate multiple-line header captions by placing a label on top of the header. This article provides an example that shows you how.



MORE INFORMATION
Visual FoxPro does not natively support multiple-line headers. However, by modifying the height of the header and placing labels with a transparent backcolor on top of the header, you can achieve the visual representation of a multiple-line header.

The following example illustrates this process using the Form Designer.

Step-by-Step Example
 Create a form. From the Form Controls toolbar, select the Grid object, and place a grid on the form. In the Property sheet, modify the Columncount property of the grid to 2.  In the Property sheet, change the HeaderHeight to 45, and set the column's header to a blank space, as follows: Grid1.HeaderHeight = 45 Grid1.Column1.Header1.Caption = " "   Change the Caption property of Header1, contained in Column1: Caption= " " &&Press the Spacebar and Click the check mark  Select the Label control from the Form Controls toolbar, and place a label on top of the header.  In the Property sheet, change the following properties for the label control: BackStyle: 0-Transparent </li>  On the Caption property, click the Fx button. After deleting the current text, type the following line in the expression builder: "First Line" + CHR(13) + "Second Line" </li> Save and run the form.</li></ol>

The header in the first column of the grid displays a two-line caption.

Keywords: kbhowto kbcode KB133164

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.