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 …

  • CentreCorp is a fully integrated and diversified property management and real estate service company, specializing in the "shopping center" segment, and is one of the premier retail service providers in North America. Company executives travel a great deal, carrying a number of traveling laptops with critical current business data, and no easy way to back up to the network outside the office. Read this case study to learn how CentreCorp implemented a suite of business continuity services that included …

Most Popular Programming Stories

More for Developers

RSS Feeds