Spread Windows Forms 8.0 Product Documentation > Developer's Guide > Customizing Interaction in Cells > Using Visible Indicators in the Cell > Displaying Text Tips in a Cell |
For cells that are too small to display all the text in the cell, you can allow the end user to see the contents in a text tip. You can set the policy and location for text tips for a cell or range of cells. Text tips can be displayed for data cells or header cells. When the pointer is over such a cell, the text tip displays.
To display a text tip over a combo box cell, you would need to turn off something. By default, the combo box cell captures the mouse when moving over the cell, so it can go into edit mode on the first click and drop-down the list. You can either turn off this behavior, by setting the Editable property to True or you can create a custom cell type and override the IsReservedLocation method to return nothing for the parts of the cell that you want the text tip to show over and return an instance of the cell type in the parts of the cell for which you want the click to open the list.
For more information refer to the TextTipAppearance property, TextTipDelay property, and TextTipPolicy property.
Refer also to the TextTipFetchEventArgs class and the TextTipFetch event and OnTextTipFetch method.
For information on scroll bar tips, refer to the section on setting scroll bar tips in Customizing the Scroll Bars of the Component.
Set the TextTipPolicy property for the Spread component.
This example sets whether to display text tips, the location of the tips, and how long to wait before the text tip is shown.
C# |
Copy Code
|
---|---|
FarPoint.Win.Spread.FpSpread fpSpread1 = new FarPoint.Win.Spread.FpSpread(); FarPoint.Win.Spread.SheetView shv = new FarPoint.Win.Spread.SheetView(); fpSpread1.Location = new Point(10, 10); fpSpread1.Height = 200; fpSpread1.Width = 400; Controls.Add(fpSpread1); fpSpread1.Sheets.Add(shv); fpSpread1.ActiveSheet.SetValue(0, 0, "TestTextTip"); fpSpread1.TextTipPolicy = FarPoint.Win.Spread.TextTipPolicy.Floating; fpSpread1.TextTipDelay = 1000; MessageBox.Show("Place the pointer over the text to see the text tip.", "", MessageBoxButtons.OK); |
VB |
Copy Code
|
---|---|
Dim FpSpread1 As New FarPoint.Win.Spread.FpSpread() Dim shv As New FarPoint.Win.Spread.SheetView() FpSpread1.Location = New Point(10, 10) FpSpread1.Height = 200 FpSpread1.Width = 400 Controls.Add(fpSpread1) FpSpread1.Sheets.Add(shv) FpSpread1.ActiveSheet.SetValue(0, 0, "TestTextTip") FpSpread1.TextTipPolicy = FarPoint.Win.Spread.TextTipPolicy.Floating FpSpread1.TextTipDelay = 1000 MessageBox.Show("Place the pointer over the text to see the text tip.", "", MessageBoxButtons.OK) |