SSSetTypeButton Function
See Also ActiveX Example 1 Example 2
Applies To
fpSpread DLL control
Description
Sets the style, text, picture, type, and shadow size for button cells.
Syntax
LPSS_CELLTYPE SSSetTypeButton(HWND hWnd, LPSS_CELLTYPE lpCellType, long Style, LPCTSTR Text, LPCTSTR Picture, short nPictureType, LPCTSTR PictureDown, short nPictureDownType, short ButtonType, short nShadowSize, LPSUPERBTNCOLOR lpColor);
LPSS_CELLTYPE TSpread::SetTypeButton(LPSS_CELLTYPE lpCellType, long Style, LPCTSTR Text, LPCTSTR Picture, short nPictureType, LPCTSTR PictureDown, short nPictureDownType, short ButtonType, short nShadowSize, LPSUPERBTNCOLOR lpColor);
Parameters
The following parameters are available:
Parameter | Description | |
---|---|---|
hWnd | Window handle of the fpSpread control | |
lpCellType | Pointer to structure to contain cell type information | |
Style | Button style Use the (|) OR operator and combine the following values as indicated: |
|
Constant | Description | |
SBS_NOINVERTFRAME | Frames do not invert when user presses the button, if frames are displayed | |
SBS_NOPOINTERFOCUS | Pointer does not have focus when over button | |
Use one of the following values: | ||
SBS_TEXTTOP_PICTBOT | Text at the top, picture at the bottom | |
SBS_TEXTBOT_PICTTOP | Text at the bottom, picture at the top | |
SBS_TEXTLEFT_PICTRIGHT | Text at the left, picture at the right | |
SBS_TEXTRIGHT_PICTLEFT | Text at the right, picture at the left | |
Use one of the following values: | ||
SBS_BTNFRAMEIN | Frame projecting in around inside of the button | |
SBS_BTNFRAMEOUT | Frame projecting out around inside of the button | |
Use one of the following values: | ||
SBS_PICTFRAMEIN | Frame projecting in around picture | |
SBS_PICTFRAMEOUT | Frame projecting out around picture | |
Use one of the following values: | ||
SBS_TEXTFRAMEIN | Frame projecting in around text | |
SBS_TEXTFRAMEOUT | Frame projecting out around text | |
Use one of the following values: | ||
SBS_TEXTICON | Icon used as text | |
SBS_TEXTBITMAP | Bitmap used as text | |
SBS_TEXTTEXT | Words used as text | |
Text | Optional text to display in the button | |
Picture | Name of optional picture to display in the button (Use the name of the bitmap specified in the resource file.)Note If the nPictureType parameter value is SUPERBTN_PICT_HANDLE, then set this as a pointer to an HICON or HBITMAP variable that is cast to LPTSTR. |
|
nPictureType | Type of picture to display Use one of the following values: |
|
Constant | Description | |
SUPERBTN_PICT_NONE | No picture | |
SUPERBTN_PICT_ICON | Icon | |
SUPERBTN_PICT_BITMAP | Bitmap | |
SUPERBTN_PICT_HANDLE | Pointer to a bitmap or icon handle or this value combined with the (|) OR operator with SUPERBTN_PICT_BITMAP or SUPERBTN_PICT_ICON | |
PictureDown | Name of optional picture to display in button when button is down | |
nPictureDownType | Type of picture to display when button is down (Valid values are listed as nPictureType parameter values.) |
|
ButtonType | Button type Use one of the following values: |
|
Constant | Description | |
SUPERBTN_TYPE_NORMAL | Button acts similar to a command button | |
SUPERBTN_TYPE_2STATE | Button has two states, up and down | |
nShadowSize | Size in pixels of the shadow area (usually 1 or 2 pixels) | |
lpColor | Button color |
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.
This function initializes a structure of the specified type (SS_CELLTYPE). You can use this structure to set an individual cell or block of cells using the SSSetCellType or SSSetCellTypeRange functions.
For two-state buttons (SUPERBTN_TYPE_2STATE), you can set or retrieve the state of the button by using the SSSetData or SSGetData functions. The text value is 1 if the button is down or 0 if the button is up.
The parent is notified when the user presses the button.
Return Value
Pointer to the SS_CELLTYPE structure, or NULL if any of the parameters are invalid.
See Also
SSGetData, SSSetCellType, SSSetCellTypeRange, SSSetData, SSSetSheet functions
SUPERBTNCOLOR structure
ActiveX Correspondence
TypeButtonAlign, TypeButtonBorderColor, TypeButtonColor, TypeButtonDarkColor, TypeButtonLightColor, TypeButtonPicture, TypeButtonPictureDown, TypeButtonShadowSize, TypeButtonText, TypeButtonTextColor, TypeButtonType properties