ComponentOne Preview Classic for WinForms: Preview Classic for WinForms Task-Based Help > Changing the Font Style in a Table > Changing the Font in a Single Table Cell

Changing the Font in a Single Table Cell

To change the font in a single table cell, set the Font property for the cell. Add the following code to the Form_Load event:

      Visual Basic

Dim table As C1.C1PrintDocument.RenderTable = New C1.C1PrintDocument.RenderTable(Me.C1PrintDocument1)

table.Body.Cell(1, 1).StyleTableCell.Font = New Font("Tahoma", 12, FontStyle.Bold)

table.Body.Cell(1, 1).StyleTableCell.TextColor = Color.DarkGreen

      C#

C1.C1PrintDocument.RenderTable table = new C1.C1PrintDocument.RenderTable(this.c1PrintDocument1);

table.Body.Cell(1, 1).StyleTableCell.Font = new Font("Tahoma", 12, FontStyle.Bold);

table.Body.Cell(1, 1).StyleTableCell.TextColor = Color.DarkGreen;

This topic illustrates the following:

The text in cell (1,1) appears in 12 point, Dark Green, Bold Tahoma font.

 


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.