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

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

  • Packaged application development teams frequently operate with limited testing environments due to time and labor constraints. By virtualizing the entire application stack, packaged application development teams can deliver business results faster, at higher quality, and with lower risk.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds