Click to See Complete Forum and Search --> : property pages


pr_101
July 1st, 1999, 05:35 PM
I have a program that uses CProperty Pages for Tab control. Here is my initialization code:

CTrinary *pMyPropSheet;
CAlpha *pMyPage2;
CCode *pMyPage3;

pMyPropSheet = new CTrinary("Trinary");
pMyPage2 = new CAlpha;
pMyPage3 = new CCode;
pMyPropSheet->AddPage(pMyPage2);
pMyPropSheet->AddPage(pMyPage3);
pMyPropSheet->DoModal();




I want to get rid of the four buttons at the bottom, the OK, Cancel, Apply, and Help. But I have no clue how to do this. Please give me step by step instructions because I am not very experienced. Thanks.

Take a look at a pic of my program to see what I mean please. I am also trying to add a minimize button to the top bar and trying to get the default button (it's the convert to code button in the pic) to work. Please help me with any of these.

http://www.geocities.com/SiliconValley/Screen/7036/helpme.jpg

olivier
July 2nd, 1999, 03:26 AM
Before the DoModal :

pMyPropSheet->m_psh.dwFlags |= PSH_NOAPPLYNOW; // No Apply Button
pMyPropSheet->m_psh.dwFlags |= ~PSH_HASHELP; // No Help Button




To remove the OK and Cancel Buttons, you should create a class CMyPropSheet which inherates from CPropertySheet,
You add the method OnInitDialog and you do

BOOL CAppliCustomizeSheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
GetDlgItem (IDOK)->ShowWindow (SW_HIDE);
GetDlgItem (IDCANCEL)->ShowWindow (SW_HIDE);

return bResult;
}




Does this help you ?

pr_101
July 2nd, 1999, 02:58 PM
Of the top two lines of code, the first line works but not the second, so I still can't get rid of the help button.

mickem
July 2nd, 1999, 03:41 PM
I think you have to do the same thing in the propery page dialog.

eg.

CMainSettings::CMainSettings() : CPropertyPage(CMainSettings::IDD)
{
//{{AFX_DATA_INIT(CMainSettings)
//}}AFX_DATA_INIT
m_psp.dwFlags &= ~PSP_HASHELP;
}