Archive: Changing Button Text


Changing Button Text
I want to change the text of the Next button on a MUI custom page depending on the radio button the user selects. I've found examples of changing the text for the Next button, but it only seemed to set it on a leave function. Is there any way to do this?


Add the notify flag to the radio buttons, then check the state item in the settings section in the leave function for the page (Take a look at \Examples\InstallOptions\testnotify.nsi)


I have the Notify flag on now and I am using this to read the state:

!insertmacro MUI_INSTALLOPTIONS_READ $R1 "NewInstall.ini" "Field 2" "State"

After that i am basically saying:
If it's 1 do something....if it's anything else, do something else.

So how do I actually change the text of the Next button once the radio button is selected?


You need to check the state of the [Settings] entry, to see which item notified that it was clicked on:


!insertmacro MUI_INSTALLOPTIONS_READ $R1 "NewInstall.ini" "Settings" "State"
StrCmp $R1 2 changenexttext
Abort

changenexttext:
GetDlgItem $MUI_TEMP1 $HWNDPARENT 0001
SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 "STR:foo"
Abort

The file Anders pointed to should have everything you need.