ComponentOne True DBGrid Pro 8
FetchCellTips Event

 

Object Reference> True DBGrid Events> FetchCellTips Event

FetchCellTips Event

If the CellTips property is not set to 0 - None, the FetchCellTips event will be fired whenever the grid has focus and the cursor is idle for a small amount of time (defined by the CellTipsDelay property) over a data cell, record selector, column header, column footer, split header, or grid caption bar.

Syntax

TDBGrid_FetchCellTips (ByVal SplitIndex As Integer, ByVal ColIndex As Integer, ByVal RowIndex As Long, CellTip As String, ByVal FullyDisplayed As Boolean, ByVal TipStyle As TrueDBGrid80.StyleDisp)

Arguments

SplitIndex is the zero-based index of the split the cursor is over.

ColIndex is an integer that identifies the column the cursor is over. This is either a zero-based column index or a (negative) CellTipConstants value.

RowIndex is an integer that identifies the row the cursor is over. This is either a zero-based row index or a (negative) CellTipConstants value.

CellTip contains the text to be displayed in the pop-up text box.

FullyDisplayed is a Boolean that is True if CellTip will fit entirely within the boundaries of the cell.

TipStyle is a Style object used to override the font and color characteristics of the cell tip text.

Remarks

This event will not fire if the cursor is over the scroll bars.

If the cursor is over a data cell, CellTip contains the contents of the cell as text. By default, the grid will display up to 256 characters of the cell contents in a pop-up text box, enabling the user to peruse the contents of a cell even if it is not big enough to be displayed in its entirety. Instead of displaying the cell text, you can also modify CellTip to display your own message. However, if you set CellTip to Null or an empty string, the text box will not be displayed.

If the cursor is not over a grid column, ColIndex will be negative and equal to one of the following CellTipConstants, depending upon the cursor position:

dbgOnRecordSelector

Cursor is over a record selector

dbgOnEmptyColumn

Cursor is over the blank area to the right of the last column

If the cursor is not over a data row, RowIndex will be negative and equal to one of the following CellTipConstants, depending upon the cursor position:

dbgOnColumnHeader

Cursor is over a column header

dbgOnSplitHeader

Cursor is over a split header

dbgOnEmptyRow

Cursor is over the empty rows area (if EmptyRows is True) or the blank area (if EmptyRows is False)

dbgOnCaption

Cursor is over the grid caption

dbgOnAddNew

Cursor is over the AddNew row

dbgOnColumnFooter

Cursor is over a column footer

If the cursor is over an empty row (that is, a row below the AddNew row), or is not over the grid cells area, the value of CellTip is Null, and the pop-up text box will not be displayed. If you modify CellTip so that it is no longer Null, the text box will display the changed value.

By setting the properties of the TipStyle object, you can control the background color, text color, and font of the pop-up text box. By default, the TipStyle object uses the system ToolTip colors and the font attributes of the current column.

You can program this event to provide context-sensitive help or tips to your users. For example, if the user points to column header, you can provide a more detailed description of the column. If the user points to a record selector, you can display instructions for selecting multiple records.

You can also provide content-sensitive help to your users using this event. By default, CellTip contains the text of the cell under the cursor. However, you can also determine other cell values if desired. Using the grid's Row property and RowBookmark method, you can retrieve the bookmark of the row under the cursor, then use the CellValue or CellText method to derive other cell values.

See Also

TDBGrid Control

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback