简体   繁体   English

如何更改CListBox / CComboBox中特定项的字体

[英]How do I change the font of a specific item in a CListBox/CComboBox

I have a CComboBox-derived class with a subclassed CListBox. 我有一个带有子类CListBox的CComboBox派生类。 I would like to make the first two item in the CListBox bold. 我想让CListBox中的前两项加粗。 How can I accomplish this? 我怎么能做到这一点?

You need an owner-draw listbox, and override DrawItem() to draw the items. 您需要一个所有者绘制列表框,并重写DrawItem()来绘制项目。 For the first two, you can use a different font than the rest. 对于前两个,您可以使用与其他字体不同的字体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM