资源描述:
《界面设计为属性选项框》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、怎样用MFC基于对话框的属性表单,属性页作为软件界面,一个属性表单包含多个属性页相当于MFC中的选型卡功能2014-03-2621:07wohaoren88I分类:VC++浏览356次:W:j
2、颜色丨字体
3、类似于这样的界面,不用TAB控件,而是由一个属性表单包含多个属性页完成,新手给个例子啊分亨到:2014-03-2621:19提问者采纳1对话框做主框架。1,仓'JSDialogBasedAppcationExewithMFCwizard2,添加资源LargePropertyPage一个,后按住CTRL点
4、击它并拖动,重复三次这样就得至IJ了三个LargePropertyPage5保持默认的IDo3,用Wizard以PAGE3作为模板,生成我们的嵌套的CMyPage»它派生白CPropertyPageo4zCPropertyPage类添力U4个成员变量:CPropertyPagem_pagel;CPropertyPagem_page2;CPropertyPagem_page3;CPropertySheetm_sheet;5,CPropertyPage类添力口消息响应:WM_CREATEWM_S:tZE,并添
5、力U如下code:if(CPropertyPage::OnCreate(IpCreateStruct)==-1)18return-1;19//TODO:Addyourspecializedcreationcodehere21m_pagel.Construct(IDD_PROPPAGE_LARGE);22m_page2.Construct(IDD_PROPPAGE_LARGE1);23m_page3.Construct(IDD_PROPPAGE_LARGE2);m_sheet•Construet("Some
6、lnfo”,this);m_sheet.AddPage(&m_pagel);m_sheet.AddPage(&m_page2);m_sheet.AddPage(&m_page3);2329m_sheet•Create(this,WS_CHILD
7、WS_VISIBLE);30return0;32voidCMyPage::OnSize(UINTnType,intex,intcy)34{CPropertyPage::OnSize(nTypezex,cy);36//TODO:Addyourmessagehandl
8、ercodehere//TODO:AddyourmessagehandlercodehereCRectrc;GetWindowRect(rc);41ScreenToClient(rc);42rc.InflateRect(0,5,0,0);m_sheet•SetWindowPos(&wndTop,rc.left,rc.top,rc•right,rc•bottom,NUL//TODO:Addyourmessagehandlercodehere46485,处理对话框类:1》添加菜单资源,IDM_MENU1,右键
9、设fit属性,MinimizeMaximize打上勾,菜单设为以上菜单。512》添加成员:CPropertyPagem_pagel;CPropertyPagem_page2;CPropertyPagem_page3;CMyPagem_MyPage;CPropertySheetm_sheet;57别忘7#include''MyPage.hH...哈哈。。。。、583》添加消息响应:WM_CREATEWM_SIZE,并添加如下code:59intCDialog_PropertyDlg::0nCreate(LP
10、CREATESTRUCTIpCreateStruct)if(CDialog::OnCreate(IpCreatestruct)==-1)return-1;64//TODO:Addyourspecializedcreationcodehere66m_pagel.Construct(IDD_PROPPAGE_LARGE);67m_page2.Construct(IDD_PROPPAGE_LARGE1);68m_page3.Construct(IDD_PROPPAGE_LARGE2);69m_MyPage.Co
11、nstruct(IDD_PROPPAGE_LARGE3);m_sheet•Construct(11Somelnfof,,this);m_sheet.AddPage(&m_pagel);m_sheet•AddPage(&m_page2);m_sheet.AddPage(&m_page3);m_sheet.AddPage(&m_MyPage);75m_sheet.Create(this,WS_CHILD
12、WS_VISIBLE);7