jcfly:是不是可不只用其中一张图就可以实现(将图画成反相)
(发表于2004-10-29 16:35:00)
SwordHChen:为什么我调用的时候第一次可以,第二次点ButtonStart却没有了呢?图片是第一次跑完的图片!~
void CBmpProgressDemoDlg::OnButtonStart()
{
GetDlgItem(IDC_BUTTON_START)->EnableWindow(FALSE); // 开始无效
m_Progress = 0;
m_TotProgress = 5;
m_Static_BmpPro.SetRange(m_Progress, m_TotProgress);
m_Static_BmpPro.SetPos(0);
m_Static_BmpPro.StepIt();
AfxBeginThread((AFX_THREADPROC)InitProgress, this);
}
DWORD InitProgress(LPVOID pParam)
{
CBmpProgressDemoDlg * pDlg = (CBmpProgressDemoDlg *)pParam;
pDlg->ProgressControl();
return TRUE;
}
void CBmpProgressDemoDlg::ProgressControl()
{
for (UINT i=0; i
{
Sleep(300);
AddProgress();
}
GetDlgItem(IDC_BUTTON_START)->EnableWindow(TRUE); // 开始有效
}
void CBmpProgressDemoDlg::AddProgress()
{
if ((++m_Progress) <= m_TotProgress)
{
m_Static_BmpPro.SetPos(m_Progress);
m_Static_BmpPro.StepIt();
}
}
(发表于2007-8-21 10:40:00)
..........................................................................
--------------------next---------------------
阅读(338) | 评论(0) | 转发(0) |