CPropertySheet标签页 实现各个CPropertyPage页面之间的切换

来源:http://bbs.csdn.net/topics/390973895

有三种方法:

第一种

是你的CPropertyPage在create的时候把原来的那个CPropertySheet 类对象指针作为父窗口传进去

CPropertyPage::Create(UINT nIDTemplate, CWnd* pParentWnd = NULL)

然后在菜单command消息处理中采用

CPropertySheet *pParent = (CPropertySheet *)GetParent();

pParent->SetActivePage(iPage);

第二种

是在你的CPropertyPage类中保存CPropertySheet 对象指针,CPropertyPage对象构造的时候传进去,然后在菜单command消息处理中直接通过这个指针SetActivePage


第三种

是在你的CPropertyPage类中保存CPropertySheet 对象的窗口句柄,CPropertyPage对象构造的时候传进去,然后在菜单command消息处理中通过这个句柄给CPropertySheet 发送自定义消息,CPropertySheet 收到这个消息的时候再SetActivePage

版权声明:本文为博主原创文章,未经博主允许不得转载。

原文地址:https://www.cnblogs.com/lovelyx/p/4867128.html