Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example clears any existing selections and selects the first five rows of the sheet.

C++

void CSelectedDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
    CDialog::OnShowWindow(bShow, nStatus);
    m_Spread.SetOperationMode(OperationModeExtended);
}

void CSelectedDlg::OnButton1()
{
    int i;
    m_Spread.ClearSelection();
    // Select the first 5 rows
    for( i=1;i<=5;i++ )
    {
        m_Spread.SetRow(i);
        m_Spread.SetSelModeSelected(TRUE);
    }
}

Visual Basic

Private Sub Form_Load()
' Set Operation Mode to extended selection
fpSpread1.OperationMode = OperationModeExtended
End Sub

Private Sub Command1_Click()
    Dim i As Integer
    'Clear selections
    fpSpread1.ClearSelection
    ' Select the first 5 rows
    For i = 1 To 5
        fpSpread1.Row = i
        fpSpread1.SelModeSelected = True
    Next i
End Sub

Copyright © GrapeCity, inc. All rights reserved.