Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example checks to see if the border around cell B3 is solid. If the border is solid it sets the border around the C3 cell as red, dash dot.

C++

void CTestDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
    CDialog::OnShowWindow(bShow,
    // Make the border around cell B3 solid, dark blue
    m_Spread1.SetCellBorder(2, 3, 2, 3, 16, RGB(0,0,255), CellBorderStyleSolid);
}

void CTestDlg::OnButton1()
{
    VARIANT Color, Style;
    m_Spread1.GetCellBorder(2, 3, 16, &Color, &Style);
    if( 1 == Style.lVal )
        m_Spread1.SetCellBorder(3, 3, 3, 3, 16, RGB(255,0,0), CellBorderStyleDashDotDot);
}

Visual Basic

Private Sub Form_Load()
    ' Make the border around cell B3 solid, dark blue
    fpSpread1.SetCellBorder 2, 3, 2, 3, 16, &H800000, CellBorderStyleSolid
End Sub

Private Sub Command1_Click()
    Dim Style As Variant
    Dim Color As Variant
    fpSpread1.GetCellBorder 2, 3, 16, Color, Style
    If Style = 1 Then
        fpSpread1.SetCellBorder 3, 3, 3, 3, 16, &HFF, CellBorderStyleDashDotDot
    End If
End Sub

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