Property Sheet in FormView
-
I want to incorporate a property sheet and pages in side a Form view. Any solution?? With Thanks and Regards --Kamesh
You need to do the following: 1) Add a frame control with ID_PLACEHOLDER into your dialog and use it to define size and position of the property sheet in your form/dialog. 2) In OnInitialUpdate() method of your form class use the following to create the property sheet (m_sheet is a member of the form class, a pointer to a property sheet class ):
CWnd* pwndPropSheetHolder = GetDlgItem(IDC_PLACEHOLDER);
m_sheet = new CMyPropertySheet(pwndPropSheetHolder);
if (!m_sheet->Create(pwndPropSheetHolder,WS_CHILD | WS_VISIBLE,0))
{
delete m_sheet;
m_sheet = NULL;
return;
}Pavel Sonork 100.15206
-
You need to do the following: 1) Add a frame control with ID_PLACEHOLDER into your dialog and use it to define size and position of the property sheet in your form/dialog. 2) In OnInitialUpdate() method of your form class use the following to create the property sheet (m_sheet is a member of the form class, a pointer to a property sheet class ):
CWnd* pwndPropSheetHolder = GetDlgItem(IDC_PLACEHOLDER);
m_sheet = new CMyPropertySheet(pwndPropSheetHolder);
if (!m_sheet->Create(pwndPropSheetHolder,WS_CHILD | WS_VISIBLE,0))
{
delete m_sheet;
m_sheet = NULL;
return;
}Pavel Sonork 100.15206
-
Thanks for the sugesstion , i have done as u suggesst, but system is failing in allocating memory for the property sheet pointer, and returning. What should i do?? With Thanks and Regards --Kamesh
Are you creating it after the inherited OnInitialUpdate is called? Returns the GetDlgItem(IDC_PLACEHOLDER) a valid pointer? Also I missed a part of the code, after the sheet is created, you need to set it's size and position:
CRect rectPropSheet;
pwndPropSheetHolder->GetWindowRect(rectPropSheet);
m_sheet->SetWindowPos(NULL, 0, 0,
rectPropSheet.Width(), rectPropSheet.Height(),
SWP_NOZORDER | SWP_NOACTIVATE);Pavel Sonork 100.15206