Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example illustrates a databound sheet (bound to BIBLIO.MDB provided with Visual Basic) that assigns the field names from the database to the ColID for each column. The text tips display the ColID, as shown in the following figure.

Visual Basic

Private Sub Form_Load()
    ' Set number of columns
    fpSpread1.MaxCols = 8
    ' Display fixed text tips
    fpSpread1.TextTip = TextTipFixed
End Sub

Private Sub fpSpread1_DataColConfig(ByVal Col As Long, ByVal DataField As String, ByVal DataType As Integer)
    ' Set up column IDs to be field names from database
    Dim x As Long
    For x = 1 To 8
        fpSpread1.Col = x
        fpSpread1.ColID = fpSpread1.DataField
    Next x
End Sub

Private Sub fpSpread1_TextTipFetch(ByVal Col As Long, ByVal Row As Long, MultiLine As Integer, TipWidth As Long, TipText As String, ShowTip As Boolean)
    ' Display column IDs as text tips
    fpSpread1.Col = Col
    TipText = fpSpread1.ColID
    ShowTip = True
End Sub

Copyright © GrapeCity, inc. All rights reserved.