简体   繁体   English

在 CPropertySheet 的属性页之间交换数据

[英]Exchanging data between property page of CPropertySheet

I have a property sheet having two pages.我有一个有两页的属性表。 The first page contains an edit box (EDITBOX1)and a check box (CHECKBOX1) .第一页包含一个编辑框 (EDITBOX1) 和一个复选框 (CHECKBOX1) 。 The second page contains also contains an edit box(EDITBOX2) with a check box(CHECKBOX2).第二页还包含一个带有复选框(CHECKBOX2) 的编辑框(EDITBOX2)。 I am trying to implement a way that when there is no value in EDITBOX1 and EDITBOX2 have some value CHECKBOX2 should be checked and it should be dithered .我正在尝试实现一种方法,当 EDITBOX1 和 EDITBOX2 中没有值时,应该检查 CHECKBOX2 并且应该抖动它。

Then when we entered somevalue to EDITBOX1 the previously checked CHECKBOX2 should not be checked and dithered.然后,当我们向 EDITBOX1 输入某个值时,不应检查和抖动先前检查的 CHECKBOX2。

Can anyone suggest me some implementation?谁能建议我一些实施? Any suggestion is appreciated.任何建议表示赞赏。 Thanks a lot!非常感谢!

Derive your own class from CPropertySheet.从 CPropertySheet 派生您自己的类。 Override CPropertySheet::OnActivatePage.覆盖 CPropertySheet::OnActivatePage。 Set the appropriate page how you want when it is activated.设置适当的页面激活时所需的方式。

Include your pages in your MyPropertySheet.h file.MyPropertySheet.h文件中包含您的页面。 Declare your pages ( CPropertyPage m_Page1 , CPropertyPage m_Page2 , ..) - as many as you need - in the MyPropertySheet.h file.MyPropertySheet.h文件中声明您的页面( CPropertyPage m_Page1CPropertyPage m_Page2 、 ..) - 根据需要尽可能多。

Add the pages to your CPropertySheet in the class constructor in MyPropertySheet.cpp file with method使用方法将页面添加到MyPropertySheet.cpp文件中的类构造函数中的CPropertySheet

CPropertySheet::AddPage(&m_Page);

Get parent of your CPropertySheet in MyPropertyPage2.cpp such as:MyPropertyPage2.cpp获取CPropertySheet父级,例如:

CMyPropertySheet* pSheet = (CMyPropertySheet*)GetParent();

Reach your m_Page1 controls pSheet->m_Page1.GetDlgItem(CHECKBOX2) from m_Page2 .m_Page2到达您的m_Page1控件pSheet->m_Page1.GetDlgItem(CHECKBOX2)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM