CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2000
    Location
    NY USA
    Posts
    275

    Text size in List Control

    Hi, gurus!

    Very easy question.
    I use InsertColumn() function to create columns in my list control. How I can change font size of the headers of my columns?

    Thanks in advance.

    KYG.


  2. #2
    igbrus is offline Elite Member Power Poster
    Join Date
    Aug 2000
    Location
    Los Angeles
    Posts
    4,658

    Re: Text size in List Control


    CFont* pMyFont = pHdrCtrl->GetFont();
    if ( pMyFont )
    {
    LOGFONT LogFont;
    memset( &LogFont, 0, sizeof(LogFont ) );
    pMyFont->GetLogFont( &LogFont );
    LogFont.lfHeight = -40;
    HFONT m_hFont = ::CreateFontIndirect( &LogFont );
    CFont* pFont = CFont::FromHandle(m_hFont);

    pHdrCtrl->SetFont( pFont );
    }





  3. #3
    Join Date
    Mar 2000
    Location
    NY USA
    Posts
    275

    Re: Text size in List Control

    Ok, but I can't figure out, why do I need to get font, make some actions, and only then set font?
    I want to set it only one time!


  4. #4
    igbrus is offline Elite Member Power Poster
    Join Date
    Aug 2000
    Location
    Los Angeles
    Posts
    4,658

    Re: Text size in List Control

    You are right. If You already have properly built CFont object, You haven't to do it.


  5. #5
    Join Date
    Mar 2000
    Location
    NY USA
    Posts
    275

    Re: Text size in List Control

    Ok, thanks for your help!


  6. #6
    Join Date
    Mar 2000
    Location
    NY USA
    Posts
    275

    Re: Text size in List Control

    But I still have problems.
    Now I can only increase the size of my text, and can't to reduce. When I set new size which is less then current, nothing happens.
    Any ideas?

    KYG.


  7. #7
    igbrus is offline Elite Member Power Poster
    Join Date
    Aug 2000
    Location
    Los Angeles
    Posts
    4,658

    Re: Text size in List Control

    It means, that current size is a minimal size for
    current font name( I guess that it's "MS San Serif" ). Try to change font name.


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