Reputation: 101
I`m having trouble finding out how to change the value of a checkbox (=property) on deselect.
What I`ve got this far:
<Property Id="INSTALLEXCEL2007" />
<Control Type="CheckBox" Id="Excel2007_Checkbox" Width="88" Height="17" X="22" Y="120" Text="Excel 2007" Property="INSTALLEXCEL2007" CheckBoxValue="1" />
The code says that the property INSTALLEXCEL2007
will get the value 1
, if the user checks it.
Now, if it is unchecked, the value still remains 1
. Meaning, each click on the checkbox assigns the value 1
to this property.
Is there any way to have a "unchecked value"?
I have already tried this, but it didn`t work in my case.
Upvotes: 0
Views: 1885
Reputation: 101
After hours of trying to get it done with checkboxes, I`ve switched to combo boxes. It has been really easy to use them, though its not as a pretty as it would have been with checkboxes.
Here`s an example of one of my combo boxes (maybe someone might find it useful):
<Control Type="ComboBox" Id="Excel2007_Combobox" Width="75" Height="14" X="165" Y="114" ComboList="yes" Property="INSTALLEXCEL2007">
<ComboBox Property="INSTALLEXCEL2007">
<ListItem Text="No" Value="0" />
<ListItem Text="Yes" Value="1" />
</ComboBox>
</Control>
After selecting a value, it`s easy to use the value of the property "INSTALLEXCEL2007" as a condition:
<Publish Dialog="ExcelChooserDlg" Control="ExcelChooser_Accept" Event="SpawnDialog" Value="WarningDlg_NoOfficeVersion" Order="1"><![CDATA[INSTALLEXCEL2007<>"1"]]></Publish>
Upvotes: 1
Reputation: 1995
If user unselects the Checkbox the property will be deleted or it value goes to null. You can use the uncheck condition like below.
INSTALLEXCEL2007 <> 1
If you test the Checkbox property value(check and uncheck) in dialog using text control, it won’t get updated. You need to publish the property or if you click next or back button, it will be updated.
Upvotes: 1