Skip to content
⌘ NSIS Forum Archive

nsDialogs - changing from Text to Password Box

5 posts

xbarns#

nsDialogs - changing from Text to Password Box

Hi all,

i use

${NSD_CreateText} 140 101 140 20 "TextBox"
Pop $TestSetup_TextBox

to create a text box, when a checkbox is checked i want to turn this into a Password Box, i tried

${NSD_AddStyle} $TestSetup_TextBox ${ES_PASSWORD}
${NSD_AddExStyle} $TestSetup_TextBox ${ES_PASSWORD}

but it does not work (kinda expected that). Anyway would this be the correct way to do this, or is there another way, or does this not work at all?

Thanks
x
T.Slappy#
${NSD_AddStyle} and ${NSD_AddExStyle} works only *before* function nsDialogs::Show is called.
Do you try to create checkbox and add listener to it [onClick method] and after clicking this checkbox [when page is already shown] then you try to set ${NSD_AddStyle} and ${NSD_AddExStyle} to checkbox?
That will not work!

Create two text boxes: 1. normal 2. password and hide/show appropriate one on checkbox click.
Do not forget to send text from one to the other after each change inside.
T.Slappy#
Originally Posted by xbarns View Post
pardon me, but how do i "hide" a box?
ShowWindow $0 ${SW_HIDE}
where $0 is HWND of desired box