(已修复)将树项目的状态更改为BOLD不会更改显示的字符串的大小 [英] (fixed) Changing to state of tree item to BOLD does not change the size of the displayed string
问题描述
将树项目的状态更改为BOLD不会更改显示的字符串的大小.
(VS2008,MFC,功能部件包).
我创建了一个CTreeCtrl并填充了一些数据.使用NM_CUSTOMDRAW
的句柄动态地绘制"项目,在CDDS_ITEMPREPAINT
中,我使用以下命令将某些项目的状态设置为粗体:
SetItemState(hItem, TVIS_BOLD, TVIS_BOLD);
多数情况下,当树被填充并且我手动更改某些其他项目的状态时,这种方法确实起作用,但是在初始化树时,设置为粗体的第一个项目的文本/标签会被剪切.
似乎新的" CTreeCtrl(通用控件版本6?)改变了树的自定义绘图的行为.
在网络上找到的一种解决方案是使用消息CCM_SETVERSION将Tree的公共控件版本更改为5.但这似乎不起作用.
创建消息后,我立即将消息发送到树中.
有人在自定义绘制树控件时遇到问题吗?
----
修复:在将粗体状态设置为项目后,我不得不重置该项目的字符串.
----
谢谢.
最多
修复:在将粗体状态设置为项目后,我不得不重置该项目的字符串.
>
Changing to state of tree item to BOLD does not change the size of the displayed string.
(VS2008, MFC, feature-pack).
I created a CTreeCtrl and filled it with some data; the items are "drawn" dynamically with the handle of NM_CUSTOMDRAW
and in the CDDS_ITEMPREPAINT
, I set the item state to bold of certain items with :
SetItemState(hItem, TVIS_BOLD, TVIS_BOLD);
This does work most of the time when the tree is filled and I manually change the state of the certains other items, but when the tree is initialized, the first item that is set to bold have its text/label clipped.
It seems the "new" CTreeCtrl (common control ver. 6 ?) changes the behaviour of the custom drawing of the tree.
One solution found in the web, is to change the common control version of the Tree to 5 with the message CCM_SETVERSION. but this does not seems to work.
I send the message to the tree just after I create it.
Anyone have issues with custom drawing a tree control ?
----
Fix: I had to reset the string of the item after the bold state was set to the item.
----
Thanks.
Max.
Fix: I had to reset the string of the item after the bold state was set to the item.
这篇关于(已修复)将树项目的状态更改为BOLD不会更改显示的字符串的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!