ComponentOne Preview Classic for WinForms: Preview Classic for WinForms Task-Based Help > Setting the Column Width

Setting the Column Width

To set the column width, set the WidthStr property. Add the following code to the Form_Load event:

      Visual Basic

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

Dim col As Integer

For col = 0 To table.Columns.Count - 1

    table.Columns(col).WidthStr = "1.75in"

Next col

      C#

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

int col;

for (col = 0; col <= table.Columns.Count - 1; col++){

    table.Columns[col].WidthStr = "1.75in";

}


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