Click to See Complete Forum and Search --> : CListCtrl


Bill Roach
June 2nd, 1999, 05:53 PM
I have multi CListCtrls in a CScrollView. I need to change the font size and get the ctrls to display in the new font. Details please, I am very confused at this point.

Paul Burns
June 2nd, 1999, 08:10 PM
just call SetFont() on 'em. you'll have to create the font's first and keep them hanging around while the list controls exist. here's an example...


// m_font1, m_font2 are CFont member var's in
// your CFormView class.
//
// Put this code in your OnInitialUpdate function.
// *Watch out though!* If you use default MFC
// doc-view stuff then calling File->Open will
// result in this code executing again and
// you'll get an assert because the object
// already exists.
//
// 10 point Courier New
m_font1.CreatePointFont(100, _T("Courier New"));
m_ListCtrl1.SetFont(&m_font1, true);

// 12 point Arial
m_font2.CreatePointFont(120, _T("Arial"));
m_ListCtrl2.SetFont(&m_font2, true);