TreeView fontsize - 自定义绘制或所有者绘制

时间:2013-01-23 21:04:19

标签: c winapi fonts treeview treeviewitem

我想更改TreeView控件的字体大小。在goolge上搜索之后,我只是想知道应该为这个TreeView使用CustomDraw。但NMTVCUSTOMDRAW结构只有clrTextclrText,它们在TreeView中设置显示文本的前景色和背景色。

我的问题是:

Q1: How to change the font size in a TreeView? For the background color of TreeView,
    one can just use `TreeView_SetBkColor` or send a message. Anything similar
    for font size?

Q2: What's the difference between Custom Draw and Owner Draw?

1 个答案:

答案 0 :(得分:2)

Q1。您可以使用WM_SETFONT消息执行此操作。

Q2。他们做类似的事情。所有者绘制是一个较旧的系统,意味着你必须自己绘制整个控件。自定义绘图更新,更灵活,如果您愿意,可以处理绘图的一部分(甚至没有绘图,只需更改字体/颜色)。