Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example sets a column width to the width of the window. You might use similar code to set a column to the visible width of the window in an MDI application.

{
RECT            Rect;
double            dfWidth;
short            dHeader;
short            dWidthInPixels;

// Retrieve the bounding rectangle for the parent window
SSGetClientRect(GetParent(hWnd), &Rect);
// Get width of header in pixels
SSGetColWidthInPixels(hWnd, SS_HEADER, &dHeader);
// Calculate width of column 1 in pixels
dWidthInPixels = Rect.right - Rect.left - dHeader;
// Convert pixels to spreadsheet coordinates
SSLogUnitsToColWidth(hWnd, dWidthInPixels, &dfWidth);
// Set column 1 to fill the entire window
SSSetColWidth(hWnd, 1, dfWidth);
}

Copyright © GrapeCity, inc. All rights reserved.