ComponentOne True DBGrid Pro 8
Context-sensitive Help with CellTips

In many Windows applications, when the user points to a toolbar button and leaves the mouse at rest for a short time, a ToolTip window appears with the name of the associated command. You can provide similar context-sensitive help for your users with the CellTips property of True DBGrid.

The CellTips property determines whether the grid displays a pop-up text window when the cursor is idle. By default, this property is set to 0 - None, and cell tips are not displayed.

If the CellTips property is set to either 1 - Anchored or 2 - Floating, the FetchCellTips event will be fired whenever the grid has focus and the cursor is idle over a grid cell, record selector, column header, column footer, split header, or grid caption. The event will not fire if the cursor is over the scroll bars.

The setting 1 - Anchored aligns the cell tip window with either the left or right edge of the cell. The left edge is favored, but the right edge will be used if necessary in order to display as much text as possible.

The setting 2 - Floating displays the cell tip window below the cursor, if possible.

If you do not provide a handler for the FetchCellTips event, and the cursor is over a grid cell, the default behavior is to display a text box containing the cell's contents (up to 256 characters). This enables the user to peruse the contents of a cell even if it is not big enough to be displayed in its entirety. You can also program the FetchCellTips event to override the default cell text display in order to provide users with context-sensitive help.

A common application of the FetchCellTips event is to display the contents of an invisible column that provides additional information about the row being pointed to, as in the following example:

Example Title
Copy Code
' General Declarations.

Dim DescCol As TrueDBGrid80.Column

 

Private Sub Form_Load()

    Set DescCol = TDBGrid1.Columns("Description")

End Sub

Private Sub TDBGrid1_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)

 

   CellTip = DescCol.CellText(TDBGrid1.RowBookmark(RowIndex))

End Sub

You can use the CellTipsDelay property to control the amount of time that must elapse before the cell tip window is displayed.

You can use the CellTipsWidth property to control the width of the cell tip window.

You can use the AnimateWindow property for additional control over the behavior of the cell tip window as it opens and closes. The AnimateWindowTime property controls how long it takes for the cell tip window to open and close, the AnimateWindowDirection property controls the direction in which the cell tip window opens, and the AnimateWindowClose property controls the way the animated cell tip window closes.

See Window Animation for more information.

 

 


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

Product Support Forum  |  Documentation Feedback