|
-
May 26th, 1999, 10:30 PM
#1
Tree control - How to edit label?
I have problems with editing label of a tree control item. I am getting the the new label only if I type some new characters. If I just leave the old characters as it is, I am getting only a NULL string in OnEndlabeleditTree(). Do somebody have a solution for this?
Thanks,
Tony
-
May 26th, 1999, 10:37 PM
#2
Re: Tree control - How to edit label?
If you leave the old characters as it is,the edit cotrol will send a NULL string to the tree control,so you must overide the CTreeCtrl::OnEndlabeledit(...)just lik this:
void CMyTreeCtrl::OnEndlabeledit(NUMHDR *pNMHDR,LRESULT *pResult)
{
TV_DISPINFO *pTVDispInfo=(TV_DISPINFO*)pNMHDR;
CString strItem=pTVDispInfo->item.pszText;
if(!strItem.IsEmpth())//if the string is //empty,do nothing!
{
SetItemText(pTVDispInfo- >item.hItem,strItem);
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|