我创建了一个对话框工程,其中对话框A上有按钮A,在对话框B上有编辑框B和按钮B,然后是对话框C.点击对话框A上的按钮A,弹出对话框B,然后再点对话框B上的编辑框B,弹出非模态对话框C,按钮A中的代码为void 对话框A::On按钮A() 
{
// TODO: Add your control notification handler code here
对话框B mydlg;
mydlg.DoModal();
}然后重载编辑框的OnLButtonUp函数,并关联对话框B上的编程框变量,以弹出非模态对话框Cvoid CMyEdit::OnLButtonUp(UINT nFlags, CPoint point) 
{
// TODO: Add your message handler code here and/or call default

kbdlg=new CKBDlg;
kbdlg->Create(IDD_DIALOG2,this);
kbdlg->ShowWindow(SW_SHOW);

CEdit::OnLButtonUp(nFlags, point);
}
再点对话框B上的按钮B,以关闭对话框C,请问这个怎么做?请给出代码
代码如下:
void 对话框B::On按钮B() 
{
// TODO: Add your control notification handler code here
请给出此处的代码,谢谢~~
}

解决方案 »

  1.   

    不给代码
    非模态dlg
    如果用模态就一层层关
      

  2.   

    void 对话框B::On按钮B()  
    {
    // TODO: Add your control notification handler code here
    //请给出此处的代码,谢谢~~
      kbdlg->DestroyWindow();
      delete kbdlg;
      kbdlg =NULL;
    }
      

  3.   

    这个是我程序的错误,自己通过另一种方法解决了,方法类似于http://blog.csdn.net/xiaoyaofriend/article/details/7755316中的方法,大家可以参考一下.