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: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • A modern mobile IT strategy is no longer an option, it is an absolute business necessity. Today's most productive employees are not tied to a desk, an office, or a location. They are mobile. And your company's IT strategy has to be ready to support them with easy, reliable, 24/7 access to the business information they need, from anywhere in the world, across a broad range of communication devices. Here's how some of the nation's most progressive corporations are meeting the many needs of their mobile workers …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds