Archive: checking one box unchecks another


checking one box unchecks another
Greetings! I've been searching help and forums for an answer and still haven't found a solution. In my installer I'm using Modern UI 2 and the component page typically lists 3-8 options for the user to select. Currently my installer allows the user to check multiple items, but I'd really only like to allow them one at a time. Checking one unchecks another (if one is checked).

Any easy way to pull this off? Any references to help or topic links would be great!

Thanks!


You can write several lines to do that. The code must be in the call-back function .onSelChange (or un.onSelChange) which is called when the selection is changed. In the body of the function you can use SectionGetFlags to get the state (see the documentation). Then you have to program a simple logic with the state and at the end you have to use SectionSetFlags to put the flags back. That's all.


There's also the StartRadioButtons, RadioButton and EndRadioButtons macros in Sections.nsh.