本文介绍了隐藏和显示对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个应用程序,在其中单击对话框的按钮时将显示消息框.显示消息框后,我想再次显示相同的对话框.
我不知道该怎么做.我尝试了ShowWindow(SW_SHOW),但是它不起作用.
请帮助我做到这一点,并告诉我如何隐藏对话框.

在此先感谢......

Hi,
I have an application in which I am displaying messagebox on button click of the dialog box. After displaying messagebox, I want to show same dialog box again.
I don''t know how to do it. I tried ShowWindow(SW_SHOW) but it''s not working.
Please help me to do this & also tell me how to hide dialogbox.

Thanks in advance......

推荐答案


void YourDialog::OnOk()
{
  AfxMessageBox("HELLO");
  OnOk();
}


然后它显示消息,并且Di8alog将不可见,
所以
对于显示消息框后保留在同一对话框中,请删除OnOk();


Then it display message and Di8alog will invisible,
So
For Remain in Same dialog after displaying messagebox please remove OnOk();

void YourDialog::OnOk()
{
  AfxMessageBox("HELLO");
  //OnOk();

}



现在,如果要隐藏对话框,则只需调用OnCancel()或OnOk();
如果无法理解,那么请在执行所有这些活动的地方提供代码块.



Now if you want to Hide the dialog then just Called OnCancel() or OnOk();
If Not understand then please provide your code block where you doing all this activities.



这篇关于隐藏和显示对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 05:11