一个继承于CPropertySheet的标签页,并且在上面通过程序CButton *bButton=new CButton做了几个按钮,但是在标签页上按下按钮后,并且弹出按下按钮响应的对话框之后,标签页自动隐藏到主框架界面的后面,希望按下按钮,弹出对话框之后,标签页不隐藏到主框架的后面。希望高手能给予帮助,万分感谢!

解决方案 »

  1.   

    Even though CPropertySheet is not derived from CDialog, managing a CPropertySheet object is similar to managing a CDialog object. For example, creation of a property sheet requires two-part construction: call the constructor, and then call DoModal for a modal property sheet or Create for a modeless property sheet. CPropertySheet has two types of constructors: CPropertySheet::Construct and CPropertySheet::CPropertySheet.
      

  2.   

    用 DoModal 显示不要用Create 和 ShowWindow
      

  3.   

    这个程序继承CPropertySheet的类假设为CMyPropertySheet,当主框架界面点击菜单时,显示其标签页,标签页为非模态的,只能通过CPropertySheet *pSheet = new CPropertySheet;
    pSheet->Create();pSheet->ShowWindow(SW_SHOW);
    当标签页被调出时,点击界面上用程序生成的按钮之后,响应消息,弹出另外一个对话框,标签页自动隐藏到主框架的后面,现在唯一就是此标签页不能通过pSheet->DoModal()的方式调用啊,希望高手能够帮忙,只要CPropertySheet能够具有CDialog的属性,无论时非模态还是模态,点击上面的按钮都能显示对话框,并且本身不隐藏到主框架的后面。