enable/disable - wizard navigation buttons

I am trying to programatically disable my custom wizard page's Next button using the EnableStep method of the wizard class.

this.EnableStep(false);

But this isn't working. Is there any other way to control the enable property of the different wizard buttons




Answer this question

enable/disable - wizard navigation buttons

  • GregM

    Try using the IsValid property of your custompage. It should return true if all values are correct, then enable or disable the next button according that.


  • wll

    Thank you for that tip. I am now able to force the user to enter the right data on every page before I let him navigate to the next page.
  • klaus_b

    Try this:

    bool enable = /* however you want to set it */ false;
    Wizard.EnableButton(Microsoft.WizardFramework.ButtonType.Next, enable);

  • AnneMMA

    If that reply was meant for me, that's not what I meant.
    I want to force the user to go through all wizard pages, not all the elements of a single page. This is done automatically if you don't overload IsValid.


  • Johnny Ni

    Using :
    Wizard.EnabledButton(
    Microsoft.WizardFramework.ButtonType.Finish, false);
    ...doesn't work to disable "step skipping", I tried it in the Load event and the constructor of my CustomWizardPage.
    Is there any way to force the user to pass through every step before hitting the Finish button



  • GregD

    I had the same problem and because I came to a solution, I thought to share it whith others. The code bellow has been put inside the page where wizard control sits. It will disable all submit buttons from the page until the page is again fully loaded.

    <script type="text/javascript">

    if (typeof(__doPostBack) == "function")

    {

    var Original__doPostBack = __doPostBack;

    __doPostBack = function(eventTarget, eventArgument)

    {

    DisableWizardButtons();

    Original__doPostBack(eventTarget, eventArgument);

    }

    }

    function DisableWizardButtons()

    {

    var els = document.getElementsByTagName('input');

    for (i=0;i<els.length;i++)

    {

    if (elsIdea.type == 'submit')

    {

    elsIdea.disabled = true;

    }

    }

    }

    </script>


  • David Navarrete

    try this...

    private void Button4_Click(object sender, System.EventArgs e)

    {

    this.Button4.Enabled=false;

    }



  • enable/disable - wizard navigation buttons