Link to home
Start Free TrialLog in
Avatar of steva
steva

asked on

Tool Tips for CStatic controls

Tool tips don't seem to work for CStatic controls.  Am I missing something?

Thanks
Steve
Avatar of DanRollins
DanRollins
Flag of United States of America image

It might be because the default ID for a StaticText control is -1.
You can create an EditBox control in read-only mode and it will look just like a Static control.

If those points don't help, then please provide some more information about your program... if this is in a dialog box, then what have you done so far to get the tooltips to work (they don't normally work in dialog boxes).
Avatar of steva
steva

ASKER

I don't think the problem is ID = -1.  I've assigned unique IDCs to all my Static text boxes and viewing Resource Symbols shows positive unique values for all of them.

Using an Edit box in read-only mode is a good idea, but it's still not quite like a Static text box, in that you can't shrink the heigth as much as you can a static box.  I have a dialog box with about 75 of these boxes and the minimum height of the edit box spreads them out a bit more than I'd like.

This is a dialog box and the tooltips work fine for  other non-static controls. To get theseto work I created a CToolTipCtrl, created a PreTranslateMessage routine to pass mouse messages to it and set up the ToolTip command with:
    pToolTip->AddTool(&m_AccessTpVal, "Throughput into bufs");
    pToolTip->AddTool&m_bufCount, "Number of bufs");
          etc.
          etc.

As long as the variables m_AccessTpVal, etc., are for CEdits this works fine.

Steve
I think you Need to have the SS_NOTIFY flag ON for your static window..

Refer this link and see article. Maybe this will help you.
http://www.codeguru.com/Cpp/controls/combobox/tooltips/article.php/c9283/

You will most likely have to modify a code to meet your needs.

-MAHESH
ASKER CERTIFIED SOLUTION
Avatar of mahesh1402
mahesh1402
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of steva

ASKER

Yes!  Just clicking Notify for the static control in Properties\Style let's the tool tip work.  Thanks.