如何改变进度条颜色?

justnight 2010-08-20 03:32:39
VS2005, CProgressCtrl, 如何改变颜色呢?

很奇怪在VS2005中找到的CProcessCtrl定义很奇怪,很少,如下
class CProgressCtrl : public CWnd
{
DECLARE_DYNAMIC(CProgressCtrl)

// Constructors
public:
CProgressCtrl();
// Generic creator
virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);

// Generic creator allowing extended style bits
virtual BOOL CreateEx(DWORD dwExStyle, DWORD dwStyle, const RECT& rect,
CWnd* pParentWnd, UINT nID);

// Attributes

// Sets range of values for the control. (16-bit limit)
void SetRange(short nLower, short nUpper);

// Sets range of values for the control. (32-bit limit)
void SetRange32(int nLower, int nUpper);

// Retrieves range of values for the control. (32-bit limit)
void GetRange(int& nLower, int& nUpper);

// Gets the current position within the set range of the control.
int GetPos();

// Sets the current position within the set range of the control.
int SetPos(int nPos);

// Displaces the current position within the set range of the
// control by the passed value.
int OffsetPos(int nPos);

// Sets the step by which increments happen with a call to StepIt().
int SetStep(int nStep);

// Sets the control's background color.
COLORREF SetBkColor(COLORREF clrNew);

// Operations

// Steps the control by the value set with SetStep().
int StepIt();

// Implementation
public:
virtual ~CProgressCtrl();
};

试过如下方法:
1.
m_StatueProgress.SendMessage(PBM_SETBKCOLOR, 0, RGB(0, 0, 255));//背景色为蓝色
m_StatueProgress.SendMessage(PBM_SETBARCOLOR, 0, RGB(255, 0, 0));//前景色为红色
2.
m_StatueProgress.SetBkColor(RGB(255,0,0));

都没用,奇怪,不知道是方法不对,还是其他因素导致未起作用,求教!
...全文
561 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
kk508 2011-02-12
  • 打赏
  • 举报
回复
什么原因啊
向立天 2010-09-16
  • 打赏
  • 举报
回复
您好
我是本版版主
此帖已多日无人关注
请您及时结帖
如您认为问题没有解决可按无满意结帖处理
另外本版设置了疑难问题汇总帖
并已在版面置顶
相关规定其帖子中有说明
您可以根据规定提交您帖子的链接
如您目前不想结帖只需回帖说明
我们会删除此结帖通知

见此回复三日内无回应
我们将强制结帖
相关规定详见界面界面版关于版主结帖工作的具体办法
jack54877012 2010-08-21
  • 打赏
  • 举报
回复
学习下
RLib 2010-08-20
  • 打赏
  • 举报
回复
把原因贴出来
justnight 2010-08-20
  • 打赏
  • 举报
回复
找到原因了,结贴

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧