Wix CheckBox Default Status

In the dialog box below, a check box is displayed, which allows you to click the "Next" button on the selected one. The problem is that I can’t set the initial state to be set to unchecked on the first form. I tried to set CheckBoxValue = 1, but this does not work either.

<Dialog Id="DatabaseDialog" X="50" Y="50" Width="373" Height="287" Title="[ProductName]"> <Control Id="EnableCheckBox" Property="DatabaseBackedUp" Type="CheckBox" X="20" Y="150" Width="290" Height="30" Text="Has the database been backed up?" CheckBoxValue="0" /> <Control Id="NextButton" Type="PushButton" X="300" Y="261" Width="66" Height="18" Text="{\VSI_MS_Sans_Serif13.0_0_0}&amp;Next &gt;" TabSkip="no" Default="yes"> <Publish Event="EndDialog" Value="Return">DatabaseDialog_NextArgs=""</Publish> <Publish Event="NewDialog" Value="[DatabaseDialog_NextArgs]">DatabaseDialog_NextArgs&lt;&gt;""</Publish> <Condition Action="disable"><![CDATA[DatabaseBackedUp<> "1"]]></Condition> <Condition Action="enable"><![CDATA[DatabaseBackedUp= "1"]></Condition> </Control> </Dialog> 
+4
source share
1 answer

So I do it and it works for me

Property:

  <Property Id="CHECKBOX" Secure="yes"></Property> 

Check box:

 <Control Id="CheckBoxId" Type="CheckBox" Text="Use the proxy server for your LAN" Property="CHECKBOX" Width="180" Height="15" X="25" Y="103" CheckBoxValue="1"/> 

I believe this works because you first set the property associated with this flag with nothing, therefore it remains empty, and if it is clicked, the value of the property is the same as that set in CheckBoxValue . (What is my logic anyway .. :)) Hope this helps

+11
source

Source: https://habr.com/ru/post/1441769/


All Articles