Old 4th April 2006, 06:24   #1
Junior Member
Join Date: Jan 2006
Posts: 7
Next Button is Visible when No Section is Selected

Hello everyone,

I have Created a new Installer Package of My project, I have added two sections in that ,
1. Installer & 2. Uninstaller.

I want to Disable the Next Button while no option is selected in that sections.

When one of the option is select "Next" button is enable, pls suggest me.

lmenaria is offline   Reply With Quote
Old 4th April 2006, 07:57   #2
Afrow UK
Afrow UK's Avatar
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Use the .onSelChange function to check when Sections are checked:

!include Sections.nsh

Section "A section" Sec1

Section "Another section" Sec2

Function .onSelChange

SectionGetFlags ${Sec1} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
StrCmp $R0 ${SF_SELECTED} +4

SectionGetFlags ${Sec2} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
StrCmp $R0 ${SF_SELECTED} 0 +4

GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 1

Goto +3

GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0


Afrow UK is offline   Reply With Quote
Old 4th April 2006, 14:14   #3
[NSIS Dev, Mod]
kichik's Avatar
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Or with the LogicLib:
!include LogicLib.nsh

Function .onSelChange

GetDlgItem $0 $HWNDPARENT 1

${If} ${SectionIsSelected} ${Sec1}
${OrIf} ${SectionIsSelected} ${Sec2}

EnableWindow $0 1


EnableWindow $0 0



NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump