Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example sets the fpSpreadPreview control's gray area to yellow, with margins of 180 twips. The sheet pages display three pages across and two pages down.

C++

// Connect fpSpread control to fpSpreadPreview control
m_Preview.SetHWndSpread(m_Spread.GetHWnd());
// Set background color to yellow, RGB(255, 255, 0)
m_Preview.SetGrayAreaColor(0x0000FFFF);
// Set gray area margins to 180 twips
m_Preview.SetGrayAreaMarginH(180);
m_Preview.SetGrayAreaMarginV(180);
// Show pages reflecting actual size
m_Preview.SetGrayAreaMarginType(GrayAreaMarginTypeActual);
// Show multiple pages in the control
m_Preview.SetPageViewType(PageViewTypeMultiplePages);
// Display three pages across and two pages down
m_Preview.SetPageMultiCntH(3);
m_Preview.SetPageMultiCntV(2);

Visual Basic

Sub Form_Load()
    ' Connect fpSpread control to fpSpreadPreview control
    fpSpreadPreview1.hWndSpread = fpSpread1.hWnd
    ' Set background color to yellow, RGB(255, 255, 0)
    fpSpreadPreview1.GrayAreaColor = &H0000FFFF&
    ' Set gray area margins to 180 twips
    fpSpreadPreview1.GrayAreaMarginH = 180
    fpSpreadPreview1.GrayAreaMarginV = 180
    ' Show pages reflecting actual size
    fpSpreadPreview1.GrayAreaMarginType = GrayAreaMarginTypeActual
    ' Show multiple pages in the control
    fpSpreadPreview1.PageViewType = PageViewTypeMultiplePages
    ' Display three pages across and two pages down
    fpSpreadPreview1.PageMultiCntH = 3
    fpSpreadPreview1.PageMultiCntV = 2
End Sub

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