单文档的属性页Dialog设置
来源:互联网 发布:nginx 二级目录跳转 编辑:程序博客网 时间:2024/05/21 15:47
To use a property sheet in your application, complete the following steps:
- Create a dialog template resource for each property page. Keep in mind that the user may be switching from one page to another, so lay out each page as consistently as possible.
The dialog templates for all pages do not have to be the same size. The framework uses the size of the largest page to determine how much space to allocate in the property sheet for the property pages.
When you create the dialog template resource for a property page, you must specify the following styles in the Dialog Properties property sheet:
- Set the Caption edit box on the General page to the text you wish to appear in the tab for this page.
- Set the Style list box on the Styles page to Child.
- Set the Border list box on the Styles page to Thin.
- Ensure that the Titlebar check box on the Styles page is selected.
- Ensure that the Disabled check box on the More Styles page is selected.
- Create a CPropertyPage-derived class corresponding to each property page dialog template. See Adding a Class. Choose CPropertyPage as the base class.
- Create member variables to hold the values for this property page. The process for adding member variables to a property page is exactly the same as adding member variables to a dialog box, because a property page is a specialized dialog box. For more information, see Defining Member Variables for Dialog Controls.
- Construct a CPropertySheet object in your source code. Usually, you construct the CPropertySheet object in the handler for the command that displays the property sheet. This object represents the entire property sheet. If you create a modal property sheet with the DoModal function, the framework supplies three command buttons by default: OK, Cancel, and Apply. The framework creates no command buttons for modeless property sheets created with the Createfunction. You do not need to derive a class from CPropertySheet unless you want to either add other controls (such as a preview window) or display a modeless property sheet. This step is necessary for modeless property sheets because they do not contain any default controls that could be used to close the property sheet.
- For each page to be added to the property sheet, do the following:
- Construct one object for each CPropertyPage-derived class that you created earlier in this process.
- Call CPropertySheet::AddPage for each page.
Typically, the object that creates the CPropertySheet also creates the CPropertyPage objects in this step. However, if you implement a CPropertySheet-derived class, you can embed the CPropertyPage objects in the CPropertySheet object and call AddPage for each page from the CPropertySheet-derived class constructor. AddPage adds the CPropertyPage object to the property sheet's list of pages but does not actually create the window for that page. Therefore, it is not necessary to wait until creation of the property sheet window to call AddPage; you can call AddPage from the property sheet's constructor.
By default, if a property sheet has more tabs than will fit in a single row of the property sheet, the tabs will stack in multiple rows. To disable stacking, callCPropertySheet::EnableStackedTabs with the parameter set to FALSE. You must call EnableStackedTabs when you create the property sheet.
- Call CPropertySheet::DoModal or Create to display the property sheet. Call DoModal to create a property sheet as a modal dialog box. Call Create to create the property sheet as a modeless dialog box.
- Exchange data between property pages and the owner of the property sheet. This is explained in the article Exchanging Data.
- 单文档的属性页Dialog设置
- Dialog Style属性设置
- 如何设置dialog下面的activity不变灰色。关于dialog的一些属性设置。
- 设置单文档应用程序的背景图片
- 设置单文档应用程序的背景图片
- 设置单文档应用程序的背景图片
- android dialog style属性设置
- 设置dialog的大小
- dialog的 主题设置
- Dialog背景的设置
- Dialog的设置
- 【整理】MFC单文档程序窗口大小的设置
- 如何设置MFC单文档主窗口的位置?
- 如何设置MFC单文档鼠标的形状?
- MFCJ基于单文档生成时默认最大化的设置
- 设置单文档CListView视图中列表的行高
- 安卓为Dialog设置属性动画
- Activity设置Dialog属性问题总结
- php - 一些好习惯
- ProgressBar更新
- iphone ios layer 教程应用
- 系统签名,共享用户ID
- Error : Failed to create sdcard in the AVD folder.
- 单文档的属性页Dialog设置
- Eclipse开发build path中jar包部署到应用中
- Hibernate中悲观锁和乐观锁
- linux 线程编程
- Javascript 正则表达式
- Oracle 11g 的 VKTM 进程 - virtual keeper of time
- static_cast、const_cast、reinterpret_cast
- Gitolite 构建 Git 服务器
- 常用正则表达式