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