BOOL CProgressStep::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here m_ProgressStep.SetRange(0,100);
m_ProgressStep.SetPos(0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}void CTree::OnStartStep() //Click单击按钮消息
{
CProgressStep m_ProgressStepStart;//CProgressStep为一个进度条类
for(int i=0;i<100;i++)
{
m_ProgressStepStart.m_ProgressStep.SetStep(1);//debug一下会在这里报错
//m_ProgressStep 为CProgressCtrl m_ProgressStep;
m_ProgressStepStart.m_ProgressStep.StepIt(); }
}请教怎么使用SetStep(1)和StepIt();
谢谢
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here m_ProgressStep.SetRange(0,100);
m_ProgressStep.SetPos(0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}void CTree::OnStartStep() //Click单击按钮消息
{
CProgressStep m_ProgressStepStart;//CProgressStep为一个进度条类
for(int i=0;i<100;i++)
{
m_ProgressStepStart.m_ProgressStep.SetStep(1);//debug一下会在这里报错
//m_ProgressStep 为CProgressCtrl m_ProgressStep;
m_ProgressStepStart.m_ProgressStep.StepIt(); }
}请教怎么使用SetStep(1)和StepIt();
谢谢
//这句的作用不明白,CProgressStep这个类是什么样子的?void CTree: nStartStep() //Click单击按钮消息
{
// CProgressStep m_ProgressStepStart;//CProgressStep为一个进度条类
for(int i=0;i <100;i++)
{
// m_ProgressStepStart.m_ProgressStep.SetStep(1);//debug一下会在这里报错
//m_ProgressStep 为CProgressCtrl m_ProgressStep;
// m_ProgressStepStart.m_Progr
[code=C/C++]CProgressStep m_ProgressStepStart;//CProgressStep为一个进度条类
//这句的作用不明白,CProgressStep这个类是什么样子的?void CTree: nStartStep() //Click单击按钮消息
{
// CProgressStep m_ProgressStepStart;//CProgressStep为一个进度条类 for(int i=0;i <100;i++)
{
// m_ProgressStepStart.m_ProgressStep.SetStep(1);//debug一下会在这里报错
//m_ProgressStep 为CProgressCtrl m_ProgressStep;
// m_ProgressStepStart.m_ProgressStep.StepIt();
m_ProgressStep.SetStep(1);
m_ProgressStep.StepIt();
}
}
CProgressStep m_ProgressStepStart;//CProgressStep为一个进度条类
//这句的作用不明白,CProgressStep这个类是什么样子的?void CTree: nStartStep() //Click单击按钮消息
{
// CProgressStep m_ProgressStepStart;//CProgressStep为一个进度条类 for(int i=0;i <100;i++)
{
// m_ProgressStepStart.m_ProgressStep.SetStep(1);//debug一下会在这里报错
//m_ProgressStep 为CProgressCtrl m_ProgressStep;
// m_ProgressStepStart.m_ProgressStep.StepIt();
m_ProgressStep.SetStep(1);
m_ProgressStep.StepIt();
}
}
:只是一个对话框,上面只有一个控件"进度条",定义为CProgressCtrl m_ProgressStepCTree这个类是什么样子的?
:这个类上有个按钮,名字“start step”
设置成100步
m_ProgressStep.SetPos(0);
从0开始
m_ProgressStep.SetStep(1);这个设置你每执行一下m_ProgressStep.StepIt()一次进度条走多少步,也就是说设置一次就够了,button里面
m_ProgressStep.StepIt(); 每执行一次走一步,执行100次进度条就满了,再走就又是重头开始。
不过,CProgressStep m_ProgressStepStart;
然后// m_ProgressStepStart.m_ProgressStep.SetStep(1);//debug一下会在这里报错
//这时候控件还没有建立,当然报错
//m_ProgressStep 为CProgressCtrl m_ProgressStep;
// m_ProgressStepStart.m_ProgressStep.StepIt(); 在CProgressStep的InitinizeDialog中完成上述操作
但是当我点击按钮“start step”后,进度条不向前进展 只是在那里不动
我记得有个OnUpdateInitDialog()消息 但是我的添加消息里面没有这个句柄啊
BOOL CProgressStep::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here m_ProgressStep.SetRange(0,100);
m_ProgressStep.SetPos(0);
m_ProgressStep.SetStep(1); m_ProgressStep.StepIt();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
{
CDialog::OnInitDialog(); // TODO: Add extra initialization here m_ProgressStep.SetRange(0,100);
m_ProgressStep.SetPos(0);
m_ProgressStep.SetStep(1); m_ProgressStep.StepIt(); return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
} void CTree::OnStartStep() //Click单击按钮消息
{
CProgressStep m_ProgressStepStart;//CProgressStep为一个进度条类
for(int i=0;i <100;i++)
{
//m_ProgressStep 为CProgressCtrl m_ProgressStep;
m_ProgressStepStart.m_ProgressStep.StepIt(); //debug一下会在这里报错
}
}
CProgressStep这个类是什么样子的?
:只是一个对话框,上面只有一个控件"进度条",定义为CProgressCtrl m_ProgressStep CTree这个类是什么样子的?
:这个类上有个按钮,名字“start step”请问该怎么调用,希望你能亲手试一试 谢谢
prg->ShowWindow(SW_NORMAL);
prg->SetRange(0, 100);
prg->SetPos(0);
prg->SetStep(1);
....
prg->StepIt();