TreeView fontsize - Custom Draw or Owner Draw

廉价感情. 提交于 2019-12-24 12:55:13

问题


I want to change the font size of a TreeView control. After searching on goolge, I just get some idea that one should use CustomDraw for this TreeView. But NMTVCUSTOMDRAW structure only has clrText and clrText which set the foreground and background color of the displayed texts in TreeView.

My questions are:

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:


Q1. You can do this with the WM_SETFONT message.

Q2. They do similar things. Owner draw is an older system and means you have to draw the entire control yourself. Custom draw is newer and more flexible, letting you handle just parts of the drawing if you like (or even no drawing, and just changing fonts/colors).



来源:https://stackoverflow.com/questions/14489358/treeview-fontsize-custom-draw-or-owner-draw

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!