更改单选按钮的内部颜色(检查所在的区域) [英] Changing radio button internal color (area where check is)

查看:82
本文介绍了更改单选按钮的内部颜色(检查所在的区域)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在考虑在应用程序中使用mfc的单选按钮显示某些状态灯,因为形状基本上已经是我想要的形状.但是,更改单选按钮的圆形部分的颜色似乎并不像我想象的那样琐碎.除了覆盖DrawItem()之外,还有谁知道其他方法吗?

覆盖DrawItem()的问题是,本质上,我不得不手动重新创建整个按钮才能覆盖颜色,这似乎违反了将其用作基础的目的.

I was thinking of using mfc''s radio button for some status lights in an application since the shape is essentially already what I want. Changing the color of the round portion of the radio button however, seems like not as trivial of a task as I assumed it might be. Does anyone know of any way of doing this other than overriding DrawItem()?

Problem with overriding DrawItem() is that essentially I''m having to recreate by hand the entire button just to override the color, seems like defeating the purpose of using that as a base.

推荐答案

您可以将控件子类化并进行一些所有者绘制的操作
you can subclass the control and make some ownerdrawn operations


,但是您错了.阅读并理解这篇精美的文章:
^ ] [^ ]
but you are wrong. Read and unterstand this fine article:
Create your own controls - the art of subclassing[^][^]


这篇关于更改单选按钮的内部颜色(检查所在的区域)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆