Question

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?
Was it helpful?

Solution

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top