Salut,
Voilà j'ai quelques problèmes pour insérer des onglets à l'intérieur d'une vue de type CFormView.
J'ai pourtant trouvé un bon exemple à l'adresse suivante:
http://www.codeguru.com/propertysheet/inside_formview.shtml
qui explique la démarche à suivre.
Au niveau du code que j'ai utilisé:
pour la classe dérivée de CFormView:
m_pInfoPropertySheet est un membre de type CPropertySheet.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 ... void CInfoView::OnInitialUpdate() { CView::OnInitialUpdate(); // TODO: Add your specialized code here and/or call the base class // create and asociated the property sheet with the "place holder" window CWnd* pwndPropSheetHolder = GetDlgItem(IDC_PLACEHOLDER); m_pInfoPropertySheet = new CInfoPropertySheet(pwndPropSheetHolder); if (!m_pInfoPropertySheet->Create(pwndPropSheetHolder,WS_CHILD | WS_VISIBLE, 0)) { delete m_pInfoPropertySheet; m_pInfoPropertySheet = NULL; return; } // fit the property sheet into the place holder window, and show it CRect rectPropSheet; pwndPropSheetHolder->GetWindowRect(rectPropSheet); m_pInfoPropertySheet->SetWindowPos(NULL, 0, 0,rectPropSheet.Width(), rectPropSheet.Height(),SWP_NOZORDER SWP_NOACTIVATE); } ...
pour la classe dérivée de CPropertySheet:
m_InfoSpePage1 et m_InfoSpePage2 sont des membres de type CPropertyPage.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 ... IMPLEMENT_DYNAMIC(CInfoPropertySheet, CPropertySheet) CInfoPropertySheet::CInfoPropertySheet(CWnd* pParentWnd) { m_InfoSpePage1.m_psp.dwFlags |= PSP_USETITLE ; m_InfoSpePage1.m_psp.pszTitle = "Entrées" ; m_InfoSpePage2.m_psp.dwFlags |= PSP_USETITLE ; m_InfoSpePage2.m_psp.pszTitle = "Sorties" ; AddPage(&m_InfoSpePage1); AddPage(&m_InfoSpePage2); } CInfoPropertySheet::~CInfoPropertySheet() { } BEGIN_MESSAGE_MAP(CInfoPropertySheet, CPropertySheet) //{{AFX_MSG_MAP(CInfoPropertySheet) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP END_MESSAGE_MAP() ...
Mon appli compile bien et s'exécute bien mais dans ma vue de type CFormView il n'y a aucun onglets![]()
Est-ce que quelqu'un a déjà eu ce genre d'ennui:
Il est à noter que je suis obligé de décocher l'option "visible" dans les propriétés de mon dialogue IDC_PLACEHOLDER sinon l'appli plante au moment d'ouvrir la vue... Peut-être est-ce un pb dans les options ???
Partager