如何改变进度条颜色?
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));
都没用,奇怪,不知道是方法不对,还是其他因素导致未起作用,求教!