Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example creates a sheet that does not display the row headers but does display row numbers using scroll tips.

C++

void CShowScrollTipsDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);

// Set up Spread display size
m_Spread.SetMaxCols(3);
m_Spread.SetVisibleCols(3);
m_Spread.SetVisibleRows(10);
m_Spread.SetAutoSize(TRUE);

// Add a some text to headers
    m_Spread.SetText(1,0,CComVariant(_T("Name")));
    m_Spread.SetText(2,0,CComVariant(_T("Rank")));
    m_Spread.SetText(3,0,CComVariant(_T("Serial Number")));
    m_Spread.SetColWidth(3, 13);

// Turn off RowHeaders and set ShowScrollTips
m_Spread.SetDisplayRowHeaders(FALSE);
m_Spread.SetShowScrollTips(ShowScrollTipsVertical);
}

Visual Basic

' Set up Spread display size
fpSpread1.MaxCols = 3
fpSpread1.VisibleCols = 3
fpSpread1.VisibleRows = 10
fpSpread1.AutoSize = True

' Add a some text to headers
fpSpread1.Row = 0
fpSpread1.Col = 1
fpSpread1.Text = "Name"
fpSpread1.Col = 2
fpSpread1.Text = "Rank"
fpSpread1.Col = 3
fpSpread1.Text = "Serial Number"
fpSpread1.ColWidth(3) = 15

' Turn off RowHeaders and set ShowScrollTips
fpSpread1.DisplayRowHeaders = False
fpSpread1.ShowScrollTips = ShowScrollTipsVertical

Copyright © GrapeCity, inc. All rights reserved.