MFC-按钮背景色 [英] MFC - Push Button Background Color

查看:253
本文介绍了MFC-按钮背景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是什么控制通过MFC项目生成的应用程序向导中的按钮中的背景色?

根据应用程序设置,我选择在生成的关于"对话框中的按钮上获得不同的背景色.在某些项目中,我获得了较旧外观的按钮,其背景色与对话框的背景色相匹配,而在另一些项目中,我获得了较新的外观按钮,其上半部与对话框的颜色相匹配,而下半部为浅蓝色.

What controls the background color in a push button on an application wizard generated through an MFC project?

Depending on the application settings I pick I get a different backgound color on my pushbutton in the generated "About" dialog box. In some projects I get the older looking button with a solid backgound color matching the dialog backgound and in others I get a newer looking button with the top half matching the dialog and the bottom half a light blue.

推荐答案

我将项目属性中的字符集从使用多字节"更改为使用Unicode",并在按钮控件上获得了新的颜色.来吧.
I changed the Character Set in the Project Properties from "use Multi-Byte" to "use Unicode" and I got the new colors on my push button control. Go figure.


MFC中的按钮外观由运行在底层OS上的当前主题控制(或者至少几年前是这样).

如果仍然如此,如果您想更改按钮的外观,则可以派生一个新类并覆盖OnPaint事件.
The button appearance in MFC is controlled by the current theme running on the underlying OS (or at least it used to be that way a few years ago).

If it''s still that way, if you want to change a button''s appearance, you have derive a new class and override the OnPaint event.


这篇关于MFC-按钮背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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