Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: FoxPro FAQ


How can I add ToolTipText to grid columns and headers? by ChrisRChamberlain
Posted: 24 Jan 03 (Edited 3 Feb 11)

Grid columns and headers do not have a .ToolTipText 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 .mToolTipText().

In the .mToolTipText() method of the form put :-

LPARAMETERS tnLeft, tnTop, tcText

IF !EMPTY(tcText)
            IF VARTYPE(.lblToolTipText)    =    [U]

                WITH .lblToolTipText
                    .AutoSize =    .T.
                    .BackColor = RGB(255,255,215)
                    .BorderStyle = 1
                    .FontName = [MS Sans Serif]
            WITH .lblToolTipText
                .Caption = tcText
                .Left = tnLeft
                .Top = tnTop + 15
                .Visible = .T.

In the .MouseEnter() events of the columns and headers put :-

lcToolTipText = [Whatever you need here]

If you prefer to use the .ToolTipText property available in VFP 8.0/9.0 instead of the variable lcToolTipText, in the .MouseEnter() events of the columns and headers put:-


In the .MouseLeave() events of the columns and headers put :-

    IF VARTYPE(.lblToolTipText) = [O]
        .lblToolTipText.Visible = .F.

Have fun.

Chris pc2

Back to Microsoft: FoxPro FAQ Index
Back to Microsoft: FoxPro Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close