• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1232
  • Last Modified:

How can I make box and font size bigger using CToolTipCtrl ?

When we use CToolTipCtrl class, the tool tip box and font size are fixed.
I want to make these box and font size bigger than original.
How can I make that ?
0
can9999
Asked:
can9999
2 Solutions
 
Deepu AbrahamR & D Engineering ManagerCommented:
Try this:
static CToolTipCtrl* pToolTip = NULL;
CToolTipCtrl* ptt =  AfxGetThreadState()->m_pToolTip;
// 4 pixel margin
CRect rc(4,4,4,4);
ptt->SetMargin(&rc);
ptt->SetTipBkColor(RGB(128,255,128));
ptt->SetMaxTipWidth(128);
pToolTip = ptt;

for more tips refer:
http://www.microsoft.com/msj/1098/vc6/vc6.aspx

Best Regards,
DeepuAbrahamK

 
0
 
jkrCommented:
To change the font size, use

   LOGFONT lf;                        // Used to create the CFont.
   CFont font;
   memset(&lf, 0, sizeof(LOGFONT));   // Clear out structure.
   lf.lfHeight = 20;                  // Request a 20-pixel-high font
   strcpy(lf.lfFaceName, "Arial");    //    with face name "Arial".
   font.CreateFontIndirect(&lf);    // Create the font.

   pToolTip->SetFont(&font);
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now