如何获得默认的复选框图像? [英] How do I get the default check box images?
问题描述
我正在尝试使用CButton构建一个所有者绘制的复选框,但是由于我只想更改文本颜色,所以我希望复选框标记保持不变.
I'm trying to build an owner-drawn check box using CButton, but since I only want to change the text color, I'd like the check-box marks to remain the same.
是否有一条命令可以让我检索运行该程序的平台的默认复选框位图?
Is there a command that allows me to retrieve the default check box bitmaps for the platform where the program is running?
(或者:如何仅更改文本颜色,并保留复选框标记?)
(alternatively: how could I change only the text color, preserving the check box marks?)
推荐答案
我使用UxTheme.dll绘制我的自定义复选框.
I use UxTheme.dll to draw my custom checkbox.
首先,我使用以下方法绘制复选框标记: DrawThemeBackground 向其传递修改后的矩形(checkboxRect.right = pCustomDraw-> rc.left + 15;)
First I draw the check-box marks using: DrawThemeBackground passing it a modified rect (checkboxRect.right = pCustomDraw->rc.left + 15;)
然后我使用:: DrawText自己绘制文本.
And then I draw the text by myself using ::DrawText.
我希望它会有所帮助.
I hope it helps.
这篇关于如何获得默认的复选框图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!