Spread 8.0 Documentation
MaxTextColWidth Property
Support Options
ActiveX Reference > ActiveX Properties > MaxTextColWidth Property

Glossary Item Box

MaxTextColWidth Property


See Also    DLL    Example

Applies To

fpSpread control

Description

Returns the width of the widest text string in the specified column. This property is available at run time only.

Syntax

C++

double CSpreadSheet::GetMaxTextColWidth(long lCol);

Visual Basic

[form.]fpSpread.MaxTextColWidth(lCol As Long)

Remarks

This setting is returned for the current sheet setting unless you first set the Sheet property to specify the sheet for which you are returning the property. Specify the column using the lCol parameter.

You can set the ColWidth property equal to the value returned from this property to size the column to display all the text in the specified column.

For edit and static text cells, the value returned is not affected by the setting of the TypeEditMultiLine, property (for edit cells) or the TypeTextWordWrap property (for static text cells). Columns with cells that display multiple lines of text return only the current column width. That is, the column width is returned, not the width of the widest text string. The calculation does include the text in button cells.

You can base the column width on the widest text in a cell instead of the specified column by using the MaxTextCellWidth property.

You can perform similar calculations for the row height using the MaxTextCellHeight and MaxTextRowHeight properties.

Data Type

Double

See Also

Resizing a Cell to Fit the Widest Data
Resizing Columns and Rows to Fit Text

ColWidth, DAutoSizeCols, MaxTextCellHeight, MaxTextCellWidth, MaxTextRowHeight, Sheet, TypeEditMultiLine, TypeTextWordWrap properties

DLL Correspondence

SSGetMaxTextColWidth function

Copyright © GrapeCity, inc. All rights reserved.