Vinoth
Vinoth

Reputation: 1995

How to set Checkbox selected by default in Wix

I am using a Checkbox and Skip a dialog box based on the check box is selected or not.

The below code for Checkbox

<Control Id="CheckBox_Samples" Type="CheckBox" X="172" Y="225" Width="274" Height="26" Property="INSTALLSAMPLES" Text="Install Samples" CheckBoxValue="TRUE" TabSkip="no" />

The below code to Skip the Dialog box.

<Control Id="Next" Type="PushButton" X="372" Y="348" Width="56" Height="17" Text="[ButtonText_Next]" Default="yes">
  <Publish Event="SetTargetPath" Value="APPDIR">INSTALL</Publish>
  <Publish Event="NewDialog" Value="NewDialog_1">INSTALL AND INSTALLSAMPLES</Publish>
  <Publish Event="NewDialog" Value="SetupTypeDlg">INSTALL AND (NOT INSTALLSAMPLES)</Publish>
</Control>

All are working fine. But the Check box always unselected by default. I want to show the Check box Selected by default.

Upvotes: 6

Views: 5081

Answers (1)

Dmitry A. Shashkin
Dmitry A. Shashkin

Reputation: 536

Controls are tied to properties so if you give the properties values, they'll show up as the default content/setting. Did you try to set your INSTALLSAMPLES property to TRUE before showing your checkbox?

Upvotes: 8

Related Questions