FlexCel Studio for VCL/LCL
ContentsIndex
PreviousUpNext
TFlexCelImport.ColumnWidth Property

Gets or sets the current Column width, in Excel internal units. (Character width of "font 0" / 256)

Pascal
property ColumnWidth [aCol: integer]: integer;
C++
__property int ColumnWidth[int aCol];
Parameters 
Description 
aCol 
Column you want to read or change (1 based) 

There is a constant "ColMult" defined on UFlxMessages that you can use to get the size in pixels. 

 

Note that this method will return the real width of the column, even if it is hidden. You might have to use ColumnHidden to know the width the user is seeing.

The following code will return the column width of column "B" in pixels:

  ColWidthInPixels := Round(FlexCelImport.ColWidth[2] / ColMult);

 

And the following code will set the column width of column "B" to 100 pixels:

  FlexCelImport.ColWidth[2] := Round(100.0 * ColMult);
Copyright (c) 2002-2008 TMS Software. All rights reserved.
What do you think about this topic? Send feedback!