Grid columns and headers do not have a [color blue].ToolTipText[/color] property, so, for instance, if you have a grid with checkboxes without text, it's difficult for a user to know what clicking on the checkbox does.
Equally using text with a checkbox can be a large waste of space.
ToolTipText will only show for a control in a column when the control gets focus, so passing the mouse up and down a column without any help in the form of ToolTipText can also be confusing to a user.
You can add ToolTipText to grid columns and headers in VFP 7.0 and later by using the following code.
Create a new form method called [color blue].mToolTipText()[/color].
In the [color blue].mToolTipText()[/color] method of the form put :-
[color blue]
LPARAMETERS tnLeft, tnTop, tcText
IF !EMPTY(tcText)
[tab]WITH THIS
[tab][tab][tab]IF VARTYPE(.lblToolTipText) =
[tab][tab][tab][tab].AddObject([lblToolTipText],[label])
In the [color blue].MouseEnter()[/color] events of the columns and headers put :-
[color blue]
lcToolTipText = [Whatever you need here]
THISFORM.mToolTipText(nXCoord,nYCoord,lcToolTipText)[/color]
If you prefer to use the .ToolTipText property available in VFP 8.0/9.0 instead of the variable lcToolTipText, in the [color blue].MouseEnter()[/color] events of the columns and headers put:-
[color blue]
THISFORM.mToolTipText(nXCoord,nYCoord,THIS.ToolTipText)[/color]
In the [color blue].MouseLeave()[/color] events of the columns and headers put :-
[color blue]
WITH THISFORM
[tab]IF VARTYPE(.lblToolTipText) = [O]
[tab][tab].lblToolTipText.Visible = .F.
[tab]ENDIF
ENDW[/color]
Have fun.
FAQ184-2483 - answering getting answered.
Chris
[link http://www.motrac.co.uk]motrac.co.uk[/link]
[link http://www.pdfcommander.com]PDFcommander[sup]tm[/sup].com[/link]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.