请问:VC中,怎样做到弹出进度条对话框,进度条完了自动关闭对话框?
请问怎样做出:在VC中,当程序运行到一个地方时,弹出一个进度条的对话框,对话框中的文字说明在进度中要不停变化,当进度条完了之后自动关闭对话框。
请问哪个地方有这样的源码或演示源码
问题点数:23、回复次数:8Top
1 楼gust(小叶)回复于 2001-12-14 12:49:13 得分 2
用模态对话框,Visual C++ MFC 编程实例中有Top
2 楼whool(喔)回复于 2001-12-14 13:39:59 得分 2
开一个定时器,定时去检查进度条有没有完,当晚了之后关闭定时器,条用对话框的OnOK()或OnCancel()就行了。Top
3 楼plusplus(面向对象)回复于 2001-12-14 13:54:40 得分 2
or you can create a work thread to do your work.
and the user thread can display a Model dialog to display the progress control.
when the work is done, use EndDialog in the Model Dialog to end the dialog.Top
4 楼cmpp()回复于 2001-12-14 15:33:28 得分 2
我来学习一下!Top
5 楼zf925(天下哪来那么多高手)回复于 2001-12-14 15:48:03 得分 10
程序中:
CLOGO CoverDlg; //LOGO画面
CoverDlg.Create();
DWORD time = ::GetCurrentTime();
while((::GetCurrentTime()-time)<1000) //延时1秒
;
//CoverDlg.BringWindowToTop();
CoverDlg.DestroyWindow();
对话框里:
BOOL CLOGO::OnInitDialog()
{
//CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_Cov.AutoLoad(ID_COV,this);
CRect Rect;
m_Cov.GetWindowRect(&Rect);
MoveWindow(Rect,FALSE); //把窗口改为图象的大小
this->CenterWindow(NULL);
return CDialog::OnInitDialog();
//return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CLOGO::Create()
{
return CDialog::Create(CLOGO::IDD);
}
Top
6 楼supperapplication(行星)回复于 2001-12-14 16:07:14 得分 3
你不是用进度条吗?里面有个pos,当pos=100的时候,发一个消息给dialog,postQuitMessage();Top
7 楼vc_dwj(深蓝)回复于 2001-12-14 16:23:47 得分 2
ok?
Top
8 楼qdbp()回复于 2001-12-15 13:46:46 得分 0
我用了EndDialog()可以关闭对话框,但要让对话框一显示出来就自动执行进度条要怎样搞Top




