Spread 8.0 Documentation
CTGetPreferredSize Event
Support Options
ActiveX Reference > ActiveX Events > CTGetPreferredSize Event

Glossary Item Box

CTGetPreferredSize Event


See Also

Applies To

fpSpread control

Description

Occurs when a custom cell type should determine its ideal size.

Syntax

C++

afx_msg void OnCTGetPreferredSizefpSpread(LPCTSTRName, const VARIANT FAR& RendererControl,short Sheet, long Col, long Row, long hDC,long CellLeft,long CellTop,long CellRight, long CellBottom,LPUNKNOWN Appearance, const VARIANT FAR& Value,long FAR* PreferredWidth, long FAR* PreferredHeight);

Visual Basic

Sub fpSpread_CTGetPreferredSize(ByVal Name As String, ByVal RendererControl As Variant, ByVal Sheet As Integer,ByVal Col As Long, ByVal Row As Long, ByVal hDC Asstdole.OLE_HANDLE, ByVal CellLeft As Single,ByVal CellTop As Single, ByVal CellRight As Single, ByVal CellBottom As Single, ByVal Appearance As FPSpreadADO.CTAppearance, ByVal Value As Variant, PreferredWidth As stdole.OLE_XSIZE_PIXELS,PreferredHeight As stdole.OLE_YSIZE_PIXELS)

Parameters

The following parameters are available:

Parameter Description
Name Name of the custom cell type
RendererControl Renderer control to use for editing the cell
Sheet Sheet number containing the custom cell
Col Column number of the cell containing the custom cell
Row Row number of the cell containing the custom cell
hDC Specifies the device context
CellLeft Left coordinate for the cell
CellTop Top coordinate for the cell
CellRight Right coordinate for the cell
CellBottom Bottom coordinate for the cell
Appearance Appearance settings for the cell (use the CTAppearance properties)
Value Value in the cell
PreferredWidth Height for the cell
PreferredHeight Width for the cell

Remarks

This event provides information about what the custom cell needs in order to display properly.

The Spread control will use this event when it is calculating text metrics for cell overflow in a custom cell and also when it is calculating text metrics for the MaxTextColWidth, MaxTextRowHeight, or MaxTextCellHeight properties.

The cell rectangle is sent using the scale mode for the form containing the Spread control (if it supports scale mode). Otherwise, the cell rectangle uses pixels.

See Also

SheetSendingEvent property

SS_CT_GETPREFERREDSIZE_ARGS structure

CTCancelEditing events

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