如何改变进度条的颜色在MFC [英] How to change the progressbar's color in MFC

查看:1411
本文介绍了如何改变进度条的颜色在MFC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

进度条的默认颜色是蓝色(也许),如何改变进度条的颜色,甚至更改mfc控件的bkcolor

the default color of the progressbar is blue(maybe),how to change the color of the progressbar?or even change the bkcolor of the mfc's controls

推荐答案

假设您使用 CProgressCtrl 命名 progressBarCtrl ,请尝试使用:

Assuming that you are working with a CProgressCtrl named progressBarCtrl, have a try with:

COLORREF clrBar = RGB(0, 0, 0); // the bar color
progressBarCtrl.SendMessage(PBM_SETBARCOLOR, 0, (LPARAM) clrBar);

作为背景:

COLORREF clrBg = RGB(255, 255, 255); // the background color
progressBarCtrl.SendMessage(PBM_SETBKCOLOR, 0, (LPARAM) clrBg);

PMB_SETBARCOLOR PBM_SETBKCOLOR 是用于更改进度条控件的颜色设置的Windows消息。

PMB_SETBARCOLOR and PBM_SETBKCOLOR are Windows messages for changing the color settings of progress bar controls.

顺便说一下,有一个方法 SetBkColor CProgressCtrl ,可用于背景颜色。

By the way, there is a method SetBkColor for CProgressCtrl which can be used for background color.

这篇关于如何改变进度条的颜色在MFC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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