Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example sets the control to display scroll tips. In the BeforeScrollTip event, the application displays the row or column index of the current row or column.

C++

BOOL CAboutDlg::OnInitDialog()
{
    CDialog::OnInitDialog();
    // Move the rows or columns with the scroll box
    m_Spread.SetScrollBarTrack(3);
    // Show the scroll tips
    m_Spread.SetShowScrollTips(3);
}

void CAboutDlg::OnBeforeScrollTipSpread1(long IsVertical, long Index, BSTR FAR* Text, VARIANT FAR* Width)
{
    char buffero[40];
    _ltoa(Index, buffero, 10);
    // Show the row or column index number
    m_Text.SetText(buffero);
}

Visual Basic

Private Sub Form_Load()
    ' Move the rows or columns with the scroll box
    fpSpread1.ScrollBarTrack = ScrollBarTrackBoth
    ' Show the scroll tips
    fpSpread1.ShowScrollTips = ShowScrollTipsBoth
End Sub

Private Sub fpSpread1_BeforeScrollTip(ByVal IsVertical As Long, ByVal Index As Long, Text As String, Width As Variant)
    ' Show the row or column index number
    Debug.Print Index
End Sub

Copyright © GrapeCity, inc. All rights reserved.