MFC——属性页对话框的创建

来源:互联网 发布:时间管理的软件 编辑:程序博客网 时间:2024/06/04 01:29

1,首先创建几个属性页对话框,并且修改其的ID号
2,使用类向导选项建立相关属性对话框页的类,这个类基于CPropertyPage类,就可以把一个界面与一个类相关起来
3,根据MSDN手册可知:
Objects of class CPropertySheet represent property sheets, otherwise known as tab dialog boxes. A property sheet consists of a CPropertySheet object and one or more CPropertyPage objects. A property sheet is displayed by the framework as a window with a set of tab indices, with which the user selects the current page, and an area for the currently selected page.
必须建立一个基于 CPropertySheet类的子类。
4,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.
将创建完的属性对话框页加载进入这个类中(新建属性对话框页的几个相关变量,在其构造函数中使用AddAddPage函数)
5,在View类中新建一个对话框,用于显示列表

0 0