CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 1999
    Location
    St. Louis
    Posts
    45

    Getting Tooltip Font

    Hello,
    I seem to be looking in all the wrong places.
    I need the system setting for tooltip/hint/info font and size.
    The colors fore/back are
    m_clrBkColor = ::GetSysColor(COLOR_INFOBK);
    m_clrFrameColor = RGB(0,0,0); // black
    m_clrTextColor = ::GetSysColor(COLOR_INFOTEXT);

    How do I get the font settings?

    Thanx
    David Giovannini


  2. #2
    Join Date
    Apr 1999
    Posts
    13

    Re: Getting Tooltip Font

    I am afraid it is not possible. When I had similar problem, I created my own control only for the purpose to use standard CToolTipCtrl class. I have found no mention in MSDN related with tooltips font
    BarD


  3. #3
    Join Date
    Mar 1999
    Location
    St. Louis
    Posts
    45

    Re: Getting Tooltip Font

    Unfortunately I need multi-lined tool-tips that I can easily change on the fly.
    I found a Balloon ToolTip class on this site. With a few modifications (including drawing) it has served me well. I am using the system font for display.

    I have noticed through regedit that tooltip font names are in current-user/control-panel/appearance/schemes/"name" byte 015C (unicode text). How to get the size and current scheme selected is another question.

    Dave


  4. #4
    Join Date
    May 1999
    Posts
    36

    Re: Getting Tooltip Font

    Hi,

    I may be way off on this, but isn't a tooltip (CToolTipCtrl) a window (i.e. CWnd)? Have you tried to call GetFont() ? Assuming that you are using a tooltip derived from CToolTipCtrl...

    Of course I've never tried this....

    HTH,



    Harvey Hawes

    Software Engineer
    BioScience Analysis Software Ltd.

    Masters Candidate
    Cardiovascular/Respiratory Sciences
    Faculty of Medicine
    University of Calgary
    Calgary, Alberta, Canada

  5. #5
    Join Date
    Mar 1999
    Location
    St. Louis
    Posts
    45

    Re: Getting Tooltip Font Answer

    Great idea and it works. The code is:
    CToolTipCtrl tool;
    tool.Create(this);
    CFont *f = tool.GetFont();
    LOGFONT pLogFont;
    f->GetLogFont(&pLogFont);
    m_fontText.CreateFontIndirect(&pLogFont);
    Thank you


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured