CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: CListCtrl

  1. #1
    Join Date
    Jun 1999
    Location
    Ventura, CA
    Posts
    26

    CListCtrl

    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.


  2. #2
    Join Date
    May 1999
    Posts
    128

    Re: CListCtrl

    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);





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