Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example sets the tab strip font, display settings, ratio, and the leftmost tab to display at run time.

C++

// Set sheet count
m_Spread.SetSheetCount(2);
// Create font
FONTDESC font = { sizeof(FONTDESC), L"Tahoma", FONTSIZE(12),FW_NORMAL, DEFAULT_CHARSET, FALSE, FALSE, FALSE };
IFontDisp* spFont;
OleCreateFontIndirect( &font, IID_IFontDisp, (void**)&spFont );

// Set font for tab
m_Spread.SetTabStripFont(spFont);
spFont->Release();
// Set tab strip properties
m_Spread.SetTabStripLeftSheet(1);
m_Spread.SetTabStripPolicy(TabStripPolicyAlways);
m_Spread.SetTabStripRatio(0.75);

Visual Basic

Private Sub Form_Load()
' Create data
Dim i As Integer
Dim j As Integer
fpSpread1.SheetCount = 2
fpSpread1.Sheet = 1
fpSpread1.MaxCols = 10
fpSpread1.MaxRows = 30
For i = 1 To 10
    For j = 1 To 30
        fpSpread1.Col = i
        fpSpread1.Row = j
        fpSpread1.Text = i & j
    Next j
Next i
' Set tab strip properties
fpSpread1.TabStripLeftSheet = 1
fpSpread1.TabStripPolicy = TabStripPolicyAlways
fpSpread1.TabStripFont.Name = "Comic Sans MS"
fpSpread1.TabStripFont.Bold = True
fpSpread1.TabStripRatio = 0.75
End Sub

Copyright © GrapeCity, inc. All rights reserved.