FlexGrid for WinForms
Setting the Font of a Single Cell
Show AllShow All
Hide AllHide All

To set the font of a single cell, create a new style and assign it to a cell.

  1. Create a new style.

    In the Designer

    • Open the C1FlexGrid Style Editor. For details on how to access the C1FlexGrid Style Editor, see Accessing the C1FlexGrid Style Editor.
    • Click Add to create a new style.
    • Double-click CustomStyle1, rename it myStyle, and press ENTER when finished.
    • Do not exit the C1FlexGrid Style Editor.

    In Code

    To write code in Visual Basic

    To write code in C#

  2. Set the font to Tahoma, 10 pt, Bold.

    In the Designer

    • In the C1FlexGrid Style Editor, locate the Font property in the right pane and click the ellipsis button. The Font dialog will appear.
    • Set the Font box to Tahoma.
    • Set the Font style box to Bold.
    • Set the Size box to 10.
    • Click OK to close the Font dialog box, but do not exit the C1FlexGrid Style Editor.

    In Code

    Add the following code to the Form_Load event:

    To write code in Visual Basic

    To write code in C#

  3. Set the font color to Blue.

    In the Designer

    • In the C1FlexGrid Style Editor, locate the ForeColor property in the right pane and set it to Blue.
    • Click OK to close the C1FlexGrid Style Editor.

    In Code

    Add the following code to the Form_Load event:

    To write code in Visual Basic

    To write code in C#

  4. Assign the style to a cell by adding the following code to the Form_Load event:

    To write code in Visual Basic

    To write code in C#

This topic illustrates the following:

Carbon appears in Blue, Bold, 10 pt, Tahoma font.


 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback