SSpread.ColWidth Property
Sets the width of the column.
This property is an Index Property. Specify the following values for the index.
| Index | Description |
|---|---|
| 0 | Line header |
| -1 | All columns |
| -2 | Column specified by Col property |
| Other than that | Column index |
The initial value is 64 .
The row height is set with the RowHeight property.
To allow the user to change the width of the column, set the UserResize and UserResizeCol properties.
The ColWidthChange event is fired when the user changes the width of a column .
The MaxTextCellWidth and MaxTextColWidth properties can be used to get the required width based on the data set in the cell.
Example of usage
ColWidth(-1) = 100;
ColWidth(2) = 200;
Col = 3;
ColWidth(-2) = 300;
print(ColWidth(1), ColWidth(2), ColWidth(3), "\n");
Related Items
MaxTextCellWidth, MaxTextColWidth, RowHeight, UserResize, UserResizeCol property
ColWidthChange event