调用domodal后,如何在属性表中添加属性页或从属性表中删除属性页! [英] How to add or delete propertypage to or from propertysheet, after domodal been called!

查看:70
本文介绍了调用domodal后,如何在属性表中添加属性页或从属性表中删除属性页!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个基于对话框的程序,然后用属性表替换了原来的对话框,代码如下所示:

I''m Writing a dialog based program, and I replaced the original dialog by a propertysheet, the code show as below:

BOOL CInstrumentCtrlApp::InitInstance()
{
	TreePropSheet::CTreePropSheet dlg; //declare propertysheet
	CAgilent34401 ag34401;    //declare propertypage
	CTDS220 tds220;       //declare propertypage
	CWelcom welcom;    //declare propertypage

	dlg.AddPage(&welcom);
	dlg.AddPage(&tds220);
	dlg.AddPage(&ag34401);

	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();
}



我想在调用"DoModal()"之后动态更改属性表(例如单击按钮以删除页面表单表),该怎么做?

问候,
Eloit



I want to dynamically change the propertysheet (like click a button to delete a page form sheet) after "DoModal()" was called, how to do it ?

regards,
Eloit

推荐答案

在PropertyPage上的Button事件处理程序中,只需调用父PropertySheet的"RemovePage()"函数即可,例如"RemovePage(this)".请注意,如果要删除活动页面(很可能是活动页面),则应使用PropertySheet函数"SetActivePage()"使其他页面变为活动页面,例如欢迎页面.

我还使用了CTreePropSheet类或其派生类,并且我记得删除页面和正确重绘树时存在一些问题.我将首先使用标准CPropertySheet进行测试,首先观察选项卡的正确显示和消失,然后再返回到CTreePropSheet类.
In your Button Event handler on the PropertyPage, just call the parent PropertySheet "RemovePage()" function, for example, "RemovePage(this)". Be careful that if you are removing the active page, which you most likely are, you should use the PropertySheet function "SetActivePage()" to have some other page become active, like your welcome page.

I also use the CTreePropSheet class, or one of its derivations, and I remember that there was some issue with deleting pages and having the tree redrawn properly. I would test this with the standard CPropertySheet first, watching the tabs appear and disappear properly first, then move back to the CTreePropSheet class.


这篇关于调用domodal后,如何在属性表中添加属性页或从属性表中删除属性页!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆