Changing font in CTreeView

The following works for me:

CMyView::OnInitialUpdate()

{

....

...

...

CFont TreeFont;

TreeFont.CreatePointFont(200, "Arial");

GetTreeCtrl.SetFont(&TreeFont);

TreeFont.Detach();

...

..

..

}

This way you don't need to store a pointer to CFont (CBrush,etc.) in your class. Storing a pointer to a CFont object in a class may cause problems when destructor is called if the handle to CFont is being held by some other object.
[563 byte] By [Adnan Zejnilovic] at [2007-11-15 22:06:47]