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

Glossary Item Box

MaxTextCellWidth Property


See Also    DLL    Example

Applies To

fpSpread control

Description

Returns the minimum width necessary to display all the text within the specified cell. This property is available at run time only.

Syntax

C++

double CSpreadSheet::GetMaxTextCellWidth( );

Visual Basic

[form.]fpSpread.MaxTextCellWidth

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. Use the Col and Row properties to specify the cell for which to return the width. Then, set the ColWidth property equal to the value returned from this property to size the column to display all the text in the specified cell.

For edit and static text cells, the value returned varies depending on the setting of the TypeEditMultiLine property (for edit cells) or the TypeTextWordWrap property (for static text cells), as listed in the following table.

TypeEditMultiLine or TypeTextWordWrap property setting Value returned
True Current cell width
False The minimum cell width necessary to display the entire line of text with no word wrap given the current font size

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

You can perform similar calculations for the row height using the MaxTextCellHeight or MaxTextRowHeight property.

Data Type

Double

See Also

Resizing a Cell to Fit the Widest Data

ColWidth, MaxTextCellHeight, MaxTextColWidth, MaxTextRowHeight, Sheet, TypeEditMultiLine, TypeTextWordWrap properties

DLL Correspondence

SSGetMaxTextCellSize function

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.