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));都没用,奇怪,不知道是方法不对,还是其他因素导致未起作用,求教!
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));都没用,奇怪,不知道是方法不对,还是其他因素导致未起作用,求教!
我是本版版主
此帖已多日无人关注
请您及时结帖
如您认为问题没有解决可按无满意结帖处理
另外本版设置了疑难问题汇总帖
并已在版面置顶
相关规定其帖子中有说明
您可以根据规定提交您帖子的链接
如您目前不想结帖只需回帖说明
我们会删除此结帖通知见此回复三日内无回应
我们将强制结帖
相关规定详见界面界面版关于版主结帖工作的具体办法