Old 27th September 2007, 23:38   #1
sticcino
Junior Member
 
Join Date: Sep 2007
Posts: 6
Question retrieving checkbox value ?

Hi,

I did a search here, but couldn't find anything to assist me.
I've created a custom form using nsDialogs, and everything is working well. The only thing is I don't understand how to retrieve the value of a CheckBox.

Funcion GetTrustedConnection
...
...
${NSD_CreateCheckbox} 75 160 100% 8u "Trusted Connection"
Pop $TRUSTEDCONNECTION
GetFunctionAddress $0 OnTrustedConnection
nsDialogs::OnClick /NOUNLOAD $TRUSTEDCONNECTION $0

nsDialogs::Show

FunctionEnd

Function OnTrustedConnection
${NSD_GetText} $TRUSTEDCONNECTION $0
${If} $0 == "1"
StrCpy $5 "Yes"
${Else}
StrCpy $5 "No"
${EndIf}
FunctionEnd

thank you,
Johnny
sticcino is offline   Reply With Quote
Old 28th September 2007, 08:38   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Send BM_GETSTATE to get the state of the checkbox.
code:
SendMessage $TRUSTEDCONNECTION ${BM_GETSTATE} 0 0 $0
${If} $0 != 0
MessageBox MB_OK checked!
${EndIf}


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
Old 28th September 2007, 18:29   #3
sticcino
Junior Member
 
Join Date: Sep 2007
Posts: 6
thank you very much, greatly appreciated

Johnny
sticcino is offline   Reply With Quote
Reply
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