Return Value
Single-precision, floating-point number of pixels in the width
For text cells or header cells with text, be sure that you turn off word wrapping by setting the WordWrap property for that text cell or header cell to false.
Column widths can be based on the data in the cells using this method or SheetView.GetPreferredColumnWidth method. For more information, see Resizing the Row and Column to Fit the Data.
FarPoint.Win.Spread.Column col; float size; col = fpSpread1.ActiveSheet.Columns[0]; fpSpread1.ActiveSheet.Cells[0, 0].Text = "This text will be used to determine the width of the column"; size = col.GetPreferredWidth(); col.Width = size;
Dim col As FarPoint.Win.Spread.Column Dim size As Single col = fpSpread1.ActiveSheet.Columns(0) fpSpread1.ActiveSheet.Cells(0, 0).Text = "This text will be used to determine the width of the column" size = col.GetPreferredWidth() col.Width = size