Spread Windows Forms 12.0 Product Documentation
TextTipFetch Event
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : TextTipFetch Event
Occurs when the pointer (cursor) is over a cell and the text tip or cell note should be displayed (the TextTip property is set to a value other than Off).
Syntax
'Declaration
 
Public Event TextTipFetch As TextTipFetchEventHandler
'Usage
 
Dim instance As FpSpread
Dim handler As TextTipFetchEventHandler
 
AddHandler instance.TextTipFetch, handler
public event TextTipFetchEventHandler TextTipFetch
Event Data

The event handler receives an argument of type TextTipFetchEventArgs containing data related to this event. The following TextTipFetchEventArgs properties provide information specific to this event.

PropertyDescription
Gets the column index of the cell that is clicked.  
Gets whether the cell is in the column footer.  
Gets whether the cell is in the column headers.  
Gets whether to fetch the cell note.  
Gets the row index of the cell that is clicked.  
Gets whether the cell is in the row headers.  
Gets or sets whether to show the text tip or show the cell note as a tip window.  
Gets or sets the text in the text tip.  
Gets or sets the width of the text tip or cell note.  
Gets the view that contains the cell that is clicked.  
Gets or sets whether the text tip or cell note should wrap for multiple lines.  
Remarks

This event is raised by the OnTextTipFetch method when the cursor is over a cell and the text tip or cell note is to be displayed.

This event works for both text tips and cell notes.

Use this event to display text tips or cell notes, to respond to the display of text tips or cell notes, to configure text tips or cell notes, or to not display a text tip or a cell note. Text tips are displayed for cells in the Spread component when the pointer is over that cell. Cell notes are displayed for cells in the Spread component when the pointer is over a cell note indicator, a red square in the upper corner of the cell. Cells can be in the data area or the headers.

Whether the TextTipFetch event occurs when the Spread component has the focus depends on the setting of the TextTipPolicy property using the values in the TextTipPolicy enumeration.

For text tips, the TextTipFetch event does not occur until after the pointer has been over the cell or header without moving for longer than the time period specified by the TextTipDelay property. For cell notes, the CellNoteIndicatorVisible property determines whether the TextTipFetch event occurs when the pointer is over the cell note indicator.

For more details on the individual event arguments, refer to TextTipFetchEventArgs members.

Example
This example raises the TextTipFetch event.
private void fpSpread1_TextTipFetch(object sender, FarPoint.Win.Spread.TextTipFetchEventArgs e)
{
     e.ShowTip = true;
     e.TipText = "I am over cell " + e.Row + " ," + e.Column;
     e.View.TextTipAppearance.Font = New Font("Comic Sans MS", 10, FontStyle.Bold);
     e.View.TextTipAppearance.BackColor = Color.Yellow;
     e.View.TextTipAppearance.ForeColor = Color.Red;
}
Private Sub FpSpread1_TextTipFetch(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.TextTipFetchEventArgs) Handles FpSpread1.TextTipFetch
     e.ShowTip = True
     e.TipText = "I am over cell " e.Row & " ," & e.Column
     e.View.TextTipAppearance.Font = New Font("Comic Sans MS", 10, FontStyle.Bold)
     e.View.TextTipAppearance.BackColor = Color.Yellow
     e.View.TextTipAppearance.ForeColor = Color.Red
End Sub
See Also