PostMan
asked on
Changing Fonts in CTreeCtrl
Does any one know if CTreeCtrl supports .SetFont() method?
and if the answer is yes, I am trying to get the stock font property of an activeX control, then set use .SetFont() to set the CTreeCtrl obj to the stock font. Here's the code I came up with,
void CDriveTreeCtrl::OnFontChan ged()
{
CFont font;
CFontHolder* pFontHolder;
HFONT hFont;
*pFontHolder = InternalGetFont();
hFont = pFontHolder->GetFontHandle ();
if(!hFont)MessageBox("NULL hFont");
m_Tree.SetFont((font.FromH andle(hFon t)),TRUE);
COleControl::OnFontChanged ();
}
Would anyone know why it doesn't work?
-PostMan
and if the answer is yes, I am trying to get the stock font property of an activeX control, then set use .SetFont() to set the CTreeCtrl obj to the stock font. Here's the code I came up with,
void CDriveTreeCtrl::OnFontChan
{
CFont font;
CFontHolder* pFontHolder;
HFONT hFont;
*pFontHolder = InternalGetFont();
hFont = pFontHolder->GetFontHandle
if(!hFont)MessageBox("NULL
m_Tree.SetFont((font.FromH
COleControl::OnFontChanged
}
Would anyone know why it doesn't work?
-PostMan
The easiest way to do what you want is using CFormView or CDialog class with consist tree control. Change font setting for dialog resource (which contain tree control) and see results.
ASKER
The CTreeCtrl is not part of the Properties dlg, but part of the Control its self. I don't think that I can use the CDialog class in this case, because the CTreeCtrl is part of the control. Also at this point it would be alot of work to change to a CFormView...
So I don't think that I want to go that root. -Thanks
So I don't think that I want to go that root. -Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.