MFC CTreeCtrl max visible item text length

Posted by Steven smethurst on Stack Overflow See other posts from Stack Overflow or by Steven smethurst
Published on 2010-03-18T19:10:14Z Indexed on 2010/03/18 19:11 UTC
Read the original article Hit count: 457

Filed under:
|

Hello

I have an application that outputs large amounts of text data to an MFC tree control. When I call SetItemText() with a long string (larger then 1000+ char) only the first ~250 chars are displayed in the control. But when I call GetItemText() on the item the entire string is returned (1000+ chars)

My questions are;

  • Is there a MAX visible string length for a MFC tree control?
  • Is there any way to increase the visible limit?

I have included example text code below

// In header 
CTreeCtrl   m_Tree;

// In .cpp file
void CTestDlg::OnDiagnosticsDebug()
{
    CString csText;
    CString csItemText;
    csText.Format( _T("0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789") );
    for( int i = 0 ; i < 10 ; i ++ ) {
        csItemText += csText ;
    }

    bool b = m_Tree.SetItemText( m_Tree.GetRootItem(), csItemText ); 
    return ; 
}

© Stack Overflow or respective owner

Related posts about mfc

Related posts about treecontrol