15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Controlling a CPropertySheet from CPropertyPage class.

Chris Marshall -- cmarshall@swallow.com
Monday, January 08, 1996

I am attempting to control the display of the header and also the control
of the Wizard buttons from within the Page Class as some pages will effect
the number of steps and also which buttons are available and when.

i.e.

Page 1 - Select a Document Type.  (Also disable Back button).
If DocType = 1 then Add 3 More Pages.
If DocType = 2 then Add 5 More Pages.
etc.

Any suggestions would be welcome.

Chris



LeRoy Baxter -- lbaxter@cinfo.com
Monday, January 08, 1996

[Mini-digest: 2 responses]

This is not a complete answer, but one method you can use is to attach
all the possible pages, then in their OnActivate() return true or false
depending on a value you set from an earlier page. You will need to 
also pay attention to the setting of the Finish button.

-----From: Niels Ull Jacobsen 

You can get the sheet from any page by doing :

CMyPage::GetSheet() {
	CPropertySheet *pSheet = (CPropertySheet*)GetParent();
	ASSERT_VALID(pSheet);
        ASSERT(pSheet->IsKindOf(RUNTIME_CLASS(CPropertySheet));
        return pSheet; 
}





| Вернуться в корень Архива |