資源描述:
《界面設(shè)計(jì)為屬性選項(xiàng)框》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
1、怎樣用MFC基于對話框的屬性表單,屬性頁作為軟件界面,一個屬性表單包含多個屬性頁相當(dāng)于MFC中的選型卡功能2014-03-2621:07wohaoren88I分類:VC++瀏覽356次:W:j
2、顏色丨字體
3、類似于這樣的界面,不用TAB控件,而是由一個屬性表單包含多個屬性頁完成,新手給個例子啊分亨到:2014-03-2621:19提問者采納1對話框做主框架。1,倉'JSDialogBasedAppcationExewithMFCwizard2,添加資源LargePropertyPage一個,后按住CTRL點(diǎn)
4、擊它并拖動,重復(fù)三次這樣就得至IJ了三個LargePropertyPage5保持默認(rèn)的IDo3,用Wizard以PAGE3作為模板,生成我們的嵌套的CMyPage?它派生白CPropertyPageo4zCPropertyPage類添力U4個成員變量:CPropertyPagem_pagel;CPropertyPagem_page2;CPropertyPagem_page3;CPropertySheetm_sheet;5,CPropertyPage類添力口消息響應(yīng):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、設(shè)fit屬性,MinimizeMaximize打上勾,菜單設(shè)為以上菜單。512》添加成員:CPropertyPagem_pagel;CPropertyPagem_page2;CPropertyPagem_page3;CMyPagem_MyPage;CPropertySheetm_sheet;57別忘7#include''MyPage.hH...哈哈。。。。、583》添加消息響應(yīng):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