Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example creates a workbook with two sheets, and provides a button that lets users insert two sheets in the workbook.

C++

BOOL CAboutDlg::OnInitDialog()
{
    CDialog::OnInitDialog();
    // Set number of sheets
    m_Spread.SetSheetCount(2);
}

void CAboutDlg::OnClickFpbtn1()
{
    // Insert two sheets before the first sheet
    m_Spread.InsertSheets(1, 2);
}

Visual Basic

Private Sub Form_Load()
    ' Add sheets
    fpSpread1.SheetCount = 2
End Sub

Private Sub Command1_Click()
    ' Insert two sheets before the first sheet
    fpSpread1.InsertSheets 1, 2
End Sub

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