Archive: Show form in MessageBox?


Show form in MessageBox?
Hi everyone,

I was wondering if it was possible in NSIS to show a form within MessageBox? I've tried, but my code fails (I can only get strings to show, none of the input boxes). Basically, I wanted the user to click on a button, which would trigger a popup (MessageBox), and that pop-up contained the next form to submit. Am trying to avoid creating another page if at all possible.

Thanks!


The only thing I know of that can do this is the DlgHost plug-in. It is extremely experimental, and should therefore never be used in a commercial product, or anything that needs to adhere to any level of reliability.

One thing you can consider is to add the form to the same page that your button is on, only make it hidden at first. Then make it visible when the button is clicked. This way, you can have many different form fields on the same page, that are disabled and invisible unless they need to be used.


Would there be a way to append a new box to the existing one then? So I have the form in the same page, just disabled, and then the size of the existing page will increase/decrease to fit the relevant form, depending on whether or not the button was clicked.


Just use nsWindows plug-in and create your own message box.

Stu


Thanks for the recommendation, Stu! I managed to figure everything but the ${NSD_CreateText} - it still shows up on the original page rather the new window (every other ${NSD_Create*} seems to work/show up in the new window.) Any idea why this would happen?

If it helps, this is my test code for the new window:

Function OnClickTrial
${NSW_CreateWindow} $WINDOW "Testing" 1044

${NSW_CreateLabel} 10 10 80 20 "Full Name:"
Pop $0

${NSD_CreateText} 85 10 150 20 "$fullName"
Pop $fullNameTextBox

${NSW_Show}
FunctionEnd


EDIT: It seems I got it to work with the INI file instead. Am still wondering why CreateText won't work otherwise; but at least the INI works.

You should probably use ${NSW_CreateLabel}, not ${NSD_CreateLabel}..?


How embarrassing, that worked! Thank you!