title: Why can't i disable the "Next" button on my custom page on Inno Setup?
body: <p>This is not working as I want it to. My code is stripped down.</p>
  
  <ul>
  <li><code>InitializeWizard</code>:</li>
  </ul>
  
  <pre><code>    procedure InitializeWizard();
      var
        strBackupFolder: String;
  
      begin
        idAutoBackupPage := pageAutoBackup_CreatePage(wpSelectTasks)
  
        { Backup Local Path }
        strBackupFolder := '';
        if (IsWin64) then
        begin
          RegQueryStringValue(HKLM64,
                  'Software\MeetSchedAssist\Meeting Schedule Assistant\Options',
                  'BackupAtShutdownLocalPath', strBackupFolder);
        end else
        begin
          RegQueryStringValue(HKLM,
                  'Software\MeetSchedAssist\Meeting Schedule Assistant\Options',
                  'BackupAtShutdownLocalPath', strBackupFolder);
        end;
  
        textBackupFolder.Text  := strBackupFolder;
  
      end;
  </code></pre>
  
  <p>So our control has the path from the reg. I have set my path in the reg to empty (like a new install).</p>
  
  <ul>
  <li><code>CurPageChanged</code></li>
  </ul>
  
  <pre><code>procedure CurPageChanged(CurPageID: Integer);
  begin
    if CurPageID = pageAutoBackup.ID then
    begin
      EnableAutoBackupSettingsNextPageButton();
    end;
  end;
  </code></pre>
  
  <p>This is the code for the EnableAuto... routine:</p>
  
  <pre><code>procedure EnableAutoBackupSettingsNextPageButton();
  begin
      if(radBackupWhatNone.Checked = False) then
      begin
          { Can we proceed? }
          if(DirExists(textBackupFolder.Text)) then
          begin
            { Yes, it is OK to proceed }
            Wizardform.NextButton.Enabled := True
          end
          else begin
            { No, it is NOT to proceed }
            Wizardform.NextButton.Enabled := True;
          end;
      end else
          { OK to proceed with Next }
          Wizardform.NextButton.Enabled := True;
  end;
  
  { Sets the state of the controls }
  procedure EnableAutoBackupSettingPageControls(bEnable: Boolean);
  begin
      pnlBackupMode.Enabled := bEnable;
      lblBackupMode.Enabled := bEnable;
      radBackupModeAuto.Enabled := bEnable;
      radBackupModeManual.Enabled := bEnable;
      lblPromptMode.Enabled := bEnable;
      cmbPromptMode.Enabled := bEnable;
      lblBackupFolder.Enabled := bEnable;
      textBackupFolder.Enabled := bEnable;
      btnSelectBackupFolder.Enabled := bEnable;
  
      EnableAutoBackupSettingsNextPageButton();
  end;
  </code></pre>
  
  <p>In short, it needs to enable the radio controls as needed and enable the <strong>Next</strong> wizard button.</p>
  
  <p>Finally:</p>
  
  <ul>
  <li>I have some action handlers:</li>
  </ul>
  
  <pre><code>{ Ask user to select the backup Folder location }
  procedure btnSelectBackupFolder_Click(Sender: TObject);
  var
    strFolder: string;
  begin
      strFolder := textBackupFolder.Text;
  
      { Display Browse Window }
      if(BrowseForFolder('', strFolder, True)) then
      begin
        textBackupFolder.Text := strFolder;
      end;
  end;
  
  { Action handler }
  procedure radBackupWhatNone_Click(Sender: TObject);
  begin
      { Set control states }
      EnableAutoBackupSettingPageControls(False);
  
  end;
  
  { Action handler }
  procedure radBackupWhatComplete_Click(Sender: TObject);
  begin
      { Set control states }
      EnableAutoBackupSettingPageControls(True);
  
  end;
  
  { Action handler }
  procedure radBackupWhatEssential_Click(Sender: TObject);
  begin
      { Set control states }
      EnableAutoBackupSettingPageControls(True);
  
  end;
  
  { Ask user to select the backup Folder location }
  procedure btnSelectBackupFolder_Click(Sender: TObject);
  var
    strFolder: string;
  begin
      strFolder := textBackupFolder.Text;
  
      { Display Browse Window }
      if(BrowseForFolder('', strFolder, True)) then
      begin
        textBackupFolder.Text := strFolder;
      end;
  
      EnableAutoBackupSettingsNextPageButton();
  end;
  </code></pre>
  
  <p>When I run this code, and the page is activated, all controls are emabled correctly expect for the main wizard Next button. It is still true. And when I click the radio options. the primary controls enable / disable. But not the Next button.</p>