
Disable NEXT button a wizard property sheet
As you have mentioned in detail, use this function in your OnSetActive()
instead of the GetDlgItem()+EnableWindow() combo.
For example
BOOL CNewSheetPage::OnSetActive()
{
m_sheet->SetWizardButtons( PSWIZB_NEXT );
if ( m_sText == _T("") ) // if empty, disable NEXT button, wait for
name...
{
// disable Next button --
m_sheet->SetWizardButtons( PSWIZB_BACK ); // or
m_sheet->SetWizardButtons( 0 ); if you do not want the BACK button.
....
}
or I believe you should be able to use the
GetDlgItem()+EnableWindow() combo in your OnInitDialog() instead of
OnSetActive().
--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------
Quote:
> Thanks for you reply.
> I checked the SetWizardButtons() member function, however I can not find
> what I want, here is summary:
> The SetWizardButtons() function can have the following flags:
> SetWizardButtons(PSWIZB_NEXT) Disables the Back button and
> enables the Next button.
> SetWizardButtons(PSWIZB_BACK) Disables the Next button and
> enables the Back button.
> SetWizardButtons(PSWIZB_FINISH) Disables the Back button, and
> replaces the Next button with an enabled Finish button
> SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT) Enables both the
> Back and Next Buttons
> SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH) Enables both
> the Back and Finish Buttons
> SetWizardButtons(PSWIZB_BACK | PSWIZB_DISABLEDFINISH) Enables
> the Back and displays a disabled Finish button instead of the Next button.
> The PSWIZB_NEXT and PSWIZB_FINISH flags cannot be used together, because
> they both use the same button position.
> Something I missed ?
> Thanks very much,
> Siman
> > Take a look at the SetWizardButtons() member function.
> > --
> > Cheers
> > Check Abdoul [ VC++ MVP ]
> > -----------------------------------
> > > Hi all,
> > > We know we have "PSWIZB_DISABLEDFINISH" that disable Finish button for
a
> > > wizard property sheet.
> > > I need a Next button, but I want to disable it before a textbox is
> filled
> > > something.
> > > I have used EnableWindow(FALSE) with that button, it does not work,
any
> > way
> > > to solve it?
> > > Thanks in advance,
> > > Siman