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

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


CPropertySheet: Displaying both Next and Finish buttons

Fernando Pereira -- morgan@cardume.com
Tuesday, February 04, 1997

Environment: NT 4.0, VC++ 4.2b

In the KB that cames with VC (and in the www.microsoft.com/kb), there's =
an article ( Q143210 ) about "How to Add the Finish Button to a Wizard =
Property Sheet"

it shows how to:=20
"By default, a wizard style property page can have either the Back/Next =
buttons or the Finish button, but not both. To have both, you can show =
the Finish button and move the Back/Next buttons. "

I found this useful as I would like to have a 5-page wizard, but, like =
in the VC++ AppWizard, possibility for a user to accept the defaults and =
just press Finish in the 2nd or 3rd page. Only problem with the =
implementation of this KB is that if I want to disable say, the back =
button in the first page, how do I do it? If I use the SetWizardButtons =
function, I will end with the NEXT or the Finish buttons?

Does anyone has a solution to this?

Thanks,
Fernando Pereira

////////////////////////////////////////////////////
// morgan@cardume.com
//
// www.cardume.com
//



Mario Contestabile -- Mario_Contestabile.UOS__MTL@UOSMTL2.universal.com
Thursday, February 06, 1997

[Mini-digest: 2 responses]

>I found this useful as I would like to have a 5-page wizard, but, like =
>in the VC++ AppWizard, possibility for a user to accept the defaults and =
>just press Finish in the 2nd or 3rd page. Only problem with the =
>implementation of this KB is that if I want to disable say, the back =
>button in the first page, how do I do it? If I use the SetWizardButtons =
>function, I will end with the NEXT or the Finish buttons?

pSheet->SetWizardButtons(PSWIZB_NEXT);
gives
 Cancel
"Back" disabled (obviously for first page).

pSheet->SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH);
gives


Fernando :

Just use Class Wizard to map OnKillActive and OnSetActive for the 
specific wizard page then use EnableWindow:

BOOL CPage5::OnSetActive() 
{
	GetParent()->GetDlgItem(ID_WIZFINISH)->EnableWindow(TRUE);
	return CPropertyPage::OnSetActive();
}

You can initially disable the back button in OnInitDialog for the 
CPropertySheet class:

GetDlgItem(ID_WIZFINISH)->EnableWindow(FALSE);

The button IDs in CPropertySheet are ID_WIZBACK, ID_WIZNEXT, 
ID_WIZFINISH, IDHELP, IDCANCEL

----------
From: 	owner-mfc-l@majordomo.netcom.com on behalf of Fernando Pereira
Sent: 	Tuesday, February 04, 1997 10:55 AM
To: 	'mfc-l@netcom.com'
Subject: 	CPropertySheet: Displaying both Next and Finish buttons

Environment: NT 4.0, VC++ 4.2b

In the KB that cames with VC (and in the www.microsoft.com/kb), there's =
an article ( Q143210 ) about "How to Add the Finish Button to a Wizard =
Property Sheet"

it shows how to:=20
"By default, a wizard style property page can have either the Back/Next =
buttons or the Finish button, but not both. To have both, you can show =
the Finish button and move the Back/Next buttons. "

I found this useful as I would like to have a 5-page wizard, but, like =
in the VC++ AppWizard, possibility for a user to accept the defaults and =
just press Finish in the 2nd or 3rd page. Only problem with the =
implementation of this KB is that if I want to disable say, the back =
button in the first page, how do I do it? If I use the SetWizardButtons =
function, I will end with the NEXT or the Finish buttons?

Does anyone has a solution to this?

Thanks,
Fernando Pereira

////////////////////////////////////////////////////
// morgan@cardume.com
//
// www.cardume.com
//





Become an MFC-L member | Вернуться в корень Архива |