|
-
March 28th, 1999, 12:16 PM
#1
PropertySheet: How to make the apply button work
I have the followig code
CPropertySheet sheet;
CPage1 page1;
CPage2 page;
sheet.AddPage(&page1);
sheet.AddPage(&page2);
sheet.DoModal();
it displays a propertysheet with ok,cancel, and apply button but the last button is not enables. How will I use the
apply button?
-
March 28th, 1999, 01:50 PM
#2
Re: PropertySheet: How to make the apply button work
Take a look at the docs for CPropertyPage::SetModified().
-
March 28th, 1999, 07:16 PM
#3
Re: PropertySheet: How to make the apply button work
As Alvaro says you first have to enable the Apply button, to do this set
CPropertyPage::SetModifed(TRUE)whenever the user changes anything in each of
your property pages
CmyPropertyPage ublic CPropertyPage {
// ...
protected:
afx_msg void OnChange();
//...}
BEGIN_MESSAGE_MAP(CmyPropertyPage,CPropertyPage)
ON_WHATEVER_CHANGES(/*what you change*/, OnChange)//call onchange when you
//handle whatever changes in the property sheet
END_MESSAGE_MAP
void CmyPropertyPage::OnChange()
{
SetModified(TRUE);
}
Once enabled you must handle it by writing in your property sheet a handler
for the BN_CLICKED message on the ID_APPLY_NOW, note that you only call
UpdateData() for the active property page, the others are already updated by
MFC. remember to update all views.
Hey if all else fails you can always add m_psh.dwFlags |=PSH_NOAPPLYNOW;
to your property sheet constructor. This hides the Apply button *grin*
-
March 28th, 1999, 07:51 PM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|