Limiting label length when editing


To limit the length of text that can be entered when editing an item label, you have to add a handler for the TVN_BEGINLABELEDIT notification. Within this handler get the edit control and call the LimitText() function.
 
void COutline::OnBeginLabelEdit(NMHDR* pNMHDR, LRESULT* pResult) 
{
        TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
        
        // Limit text to 127 characters
        GetEditControl()->LimitText(127);

        *pResult = 0;
}



Comments

  • TreeCtrl - Label visualization limited to 260 characters

    Posted by Legacy on 10/25/2002 12:00am

    Originally posted by: Michele

    I need to display long labels (more than 260 characters) but I'm not able do it. 
    
    Even if I set the label length longer than 260 characters through "myTreeCtrl.GetEditControl()->LimitText(500);" instruction, the visualization is limited to 260 characters.
    Is there a way to remove this limit ?
    Any suggestion is welcome.

    Bye
    Michele

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • VMware vCloud® Government Service provided by Carpathia® is an enterprise-class hybrid cloud service that delivers the tried and tested VMware capabilities widely used by government organizations today, with the added security and compliance assurance of FedRAMP authorization. The hybrid cloud is becoming more and more prevalent – in fact, nearly three-fourths of large enterprises expect to have hybrid deployments by 2015, according to a recent Gartner analyst report. Learn about the benefits of …

Most Popular Programming Stories

More for Developers

RSS Feeds