ComponentOne FlexGrid for WinForms
Adding Three-Dimensional Text to a Header Row
FlexGrid for WinForms Task-Based Help > Adding Three-Dimensional Text to a Header Row

To add three-dimensional text to the table's header row, set the TextEffect property to Raised for text with a shadow offset by one pixel to the right and below the text or Inset for text with a shadow offset by one pixel to the left and above the text. Setting the TextEffect property to Flat gives text no effect.

  1. Create a new style called 3DText.

    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 3DText, and press ENTER when finished.
    • Do not exit the C1FlexGrid Style Editor.

    In Code

    Add the following code to the Form_Load event:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim tdt As C1.Win.C1FlexGrid.CellStyle
    

    To write code in C#

    C#
    Copy Code
    C1.Win.C1FlexGrid.CellStyle tdt = this.c1FlexGrid1.Styles.Add("3Dtext");
    
  2. Set the TextEffect property to Raised.

    In the Designer

    Locate the TextEffect property in the right pane and set it to Raised.

    In Code

    Add the following code to the Form_Load event:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    tdt.TextEffect = C1.Win.C1FlexGrid.TextEffectEnum.Raised
    

    To write code in C#

    C#
    Copy Code
    tdt.TextEffect = C1.Win.C1FlexGrid.TextEffectEnum.Raised;
    
  3. Apply the style to the header row by adding the following code to the Form_Load event:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1FlexGrid1.Rows(0).Style = Me.C1FlexGrid1.Styles("3DText")
    

    To write code in C#

    C#
    Copy Code
    this.c1FlexGrid1.Rows[0].Style = this.c1FlexGrid1.Styles["3DText"];
    

This topic illustrates the following:

The table should have a header with raised text similar to the following image.