Spread 8.0 Documentation
SSGetMaxTextColWidth Function
Support Options
DLL Reference > DLL Functions > SSGetMaxTextColWidth Function

Glossary Item Box

SSGetMaxTextColWidth Function


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Returns the width of the widest text string in the specified column.

Syntax

C

BOOL SSGetMaxTextColWidth(HWND hWnd, SS_COORD Col, LPDOUBLE lpdfColWidth);

C++

BOOL TSpread::GetMaxTextColWidth(SS_COORD Col, LPDOUBLE lpdfColWidth);

Parameters

This function has the following parameters:

Parameter Description
hWnd Window handle of the fpSpread control
Col Column number
lpdfColWidth Pointer to variable that receives text width
(Value is in sheet coordinates.)

Remarks

This function is applied to the current sheet setting unless you first call the SSSetSheet function to specify the sheet for which you are calling this function.

Cells that display multiple lines of text return only the current column width. That is, the column width is returned in the lpdfColWidth parameter, not the width of the widest text string. The calculation does include the text in button cells.

You can pass the returned value to the SSSetColWidth function to change the column width to reflect the widest string.

Note: By default, text wraps in header cells and does not wrap in cells in the body of the sheet.

Return Value

TRUE if the function completes successfully; FALSE otherwise.

See Also

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

SSGetMaxTextCellSize, SSGetMaxTextRowHeight, SSSetColWidth, SSSetSheet functions

ActiveX Correspondence

MaxTextColWidth property

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