Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example sets the sheet to display different colors for odd and even rows. It also specifies the background and foreground colors to display for a row or column when the row or column is selected.

C++

void CMyWnd::MyFunc()
{
    bool x;
    // Set odd/even row colors as follows
    // Odd background: cyan, RGB(0, 255, 255)
    // Odd foreground: dark cyan, RGB(0, 128, 128)
    // Even background: blue, RGB(0, 0, 255)
    // Even foreground: dark blue, RGB(0, 0, 128)
    x = fpSpread1.SetOddEvenRowColor(0x00FFFF00, 0x00808000, 0x00FF0000, 0x00800000);
    // Set selection background color magenta, RGB(192, 0, 192)
    fpSpread1.SetSelBackColor(0x00C000C0);
    // Set selection foreground color dark magenta, RGB(128, 0, 128)
    fpSpread1.SetSelForeColor(0x00800080);
}

Visual Basic

Sub Form_Load()
    Dim x As Boolean
    ' Set odd/even row colors as follows
    ' Odd background: cyan, RGB(0, 255, 255)
    ' Odd foreground: dark cyan, RGB(0, 128, 128)
    ' Even background: blue, RGB(0, 0, 255)
    ' Even foreground: dark blue, RGB(0, 0, 128)
    x = fpSpread1.SetOddEvenRowColor(&H00FFFF00,&H00808000, &H00FF0000, &H00800000)
    ' Set selection background color magenta, RGB(192, 0, 192)
    fpSpread1.SelBackColor = &H00C000C0
    ' Set selection foreground color dark magenta, RGB(128, 0, 128)
    fpSpread1.SelForeColor = &H00800080
End Sub

Copyright © GrapeCity, inc. All rights reserved.