在程序中使用CTreeCtrl::SetItemText()函数可以设置长度超过1000个字节的文本字串,
但在界面中只能显示出前257个字符(滚动条到头).是不是CTreeCtrl中能显示的条目文本的最大长度有限制? 最大值是多少?
谢谢!

解决方案 »

  1.   

    Note that although the tree-view control allows any length string to be stored as item text, only the first 260 characters are displayed
      

  2.   

    如果显示的太长可以先加个省略号,然后用CToolTip样式来显示
      

  3.   

    flyelf(空谷清音):非常感谢你的回答.
    我想知道你是从哪里得到的结论? 我的意思是你能告诉我以上结论的出处吗?客户认为我们的产品中, CTreeCtrl不能显示超过260个字节的文本行, 可是我认为这是控件本身的限制. 所以我们需要找到证据, 最好是"官方"的或较正式的文档, 说明你的以下结论.Note that although the tree-view control allows any length string to be stored as item text, only the first 260 characters are displayed
      
      

  4.   

    不过客户可不管控间怎么样,我见过一个客户提的需求很奇怪,我们就说MS的东西不能满足他的需求,他反问我们,我是让你们开发东西,关MS什么事,所以即使tree只能显示260个char,我想你还是要想办法把生下的显示出来,不过显示那么多累不累阿,你为什么不在tree上显示缩略,在一个EDIT中显示全部内容呢
      

  5.   

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listview/structures/lvitem.asp看pszText字段的解释如果用tip,请参看
    http://www.codeguru.com/Cpp/controls/treeview/article.php/c3997/
    http://www.codeguru.com/Cpp/controls/treeview/article.php/c3995/