ToolTipText remains one of the most efficient means of showing information about a control in VFP.
However should you wish to display more than the average amount of data, you have the visual problem of it being displayed on a single line, and ultimately a string length limit of 127 characters.
The following code demonstrates how, in VFP 7.0, you can split the information over up to four lines and also include blank lines if needed.
By increasing the number of parameters/lines in the example code, you can utilise up to 256 characters, (including spaces), for the display.
Add a label to your form and rename it [color blue].lblToolTipText[/color]
Change the following properties of the label
[color blue]
.FontName = [MS Sans Serif]
.FontSize = 9
.Visible = .F.
[/color]
In the [color blue].MouseEnter()[/color] event of the control(s) for which you wish to display ToolTipText put :-
[color blue]
lcLine1 = [This is the first line to display]
lcLine2 = [This is just another line]
lcLine3 = [And one more for luck!]
lcLine4 = [And yet another one for luck!]
It isn't necessary to pass any more than 3 parameters to the method [color blue]THISFORM.mToolTipText()[/color], so you only need create as many lines as you require.
In the [color blue].MouseLeave()[/color] event of the control(s) put :-
[color blue]
THISFORM.lblToolTipText.Visible = .F.[/color]
Remove any existing ToolTipText for the control(s).
Create a new form method called [color blue].mToolTipText()[/color] and put :-
[color blue]
LPARAMETERS ;
[tab]tnLeft ,;
[tab]tnTop ,;
[tab]tcLine1 ,;
[tab]tcLine2 ,;
[tab]tcLine3 ,;
[tab]tcLine4
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.