Next Button or something else?
Hello,
I am having problem with the behaviour of the custom dialog box I have created. This dialog box displays 'Next' button disabled until you click on CheckBox. Selecting Check box make the 'Next' button enabled. Which works perfectly fine until you click on 'Next'. Once you click 'Next' and again if I come back to the same custom page by clicking 'Back' then Clicking checkbox take me to the previous screen Where it should just enable or disable the Next button. Following is the code..Can someone help me to sort the problem.
Thanks, Monika

Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "Warning.ini"
FunctionEnd

Function WarningPage
!insertmacro MUI_INSTALLOPTIONS_READ $CHK_CONTINUESTATE "Warning.ini" "Field 2" "State"

;Before Displaying the page retain the settings to display next button enabled/disabled accordingly.
GetDlgItem $NEXTWINDOW $HWNDPARENT 1
EnableWindow $NEXTWINDOW 0

StrCmp $CHK_CONTINUESTATE "1" +3
EnableWindow $NEXTWINDOW 0
Goto +2
EnableWindow $NEXTWINDOW 1


!insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Field 1" "Text" $(WARNING_MAIN_TEXT)
!insertmacro MUI_INSTALLOPTIONS_WRITE "Warning.ini" "Field 2" "Text" $(WARNING_CONTINUE)


!insertmacro MUI_INSTALLOPTIONS_DISPLAY "Warning.ini"

FunctionEnd

Function WarningPage_Leave

!insertmacro MUI_INSTALLOPTIONS_READ $CHK_CONTINUE "Warning.ini" "Settings" "State"



StrCmp $CHK_CONTINUE 0 ClickNextBtn
StrCmp $CHK_CONTINUE 2 NextBtnState


NextBtnState:
!insertmacro MUI_INSTALLOPTIONS_READ $CHK_CONTINUESTATE "Warning.ini" "Field 2" "State"

GetDlgItem $NEXTWINDOW $HWNDPARENT 1

StrCmp $CHK_CONTINUESTATE "1" +3
EnableWindow $NEXTWINDOW 0
Goto +2
EnableWindow $NEXTWINDOW 1

Abort


ClickNextBtn:


FunctionEnd