【问题标题】:Check checkbox when another checkbox is checked选中另一个复选框时选中复选框
【发布时间】:2016-01-26 14:24:29
【问题描述】:

这是我的 WIX:

<Control Id="FeatureOneBox" Type="CheckBox" Property="FEATUREONE" Text="Feature One" X="30" Y="87" Height="10" Width="200" CheckBoxValue="1" />
<Control Id="FeatureTwoBox" Type="CheckBox" Property="FEATURETWO" Text="Feature Two" X="30" Y="107" Height="10" Width="200" CheckBoxValue="1" />
<Control Id="FeatureThreeBox" Type="CheckBox" Property="FEATURETHREE" Text="Feature Three" X="30" Y="107" Height="10" Width="200" CheckBoxValue="1" />
<Control Id="CoreFeatureBox" Type="CheckBox" Property="INSTALLCORE" Text="!(loc.CoreFeatureBox)" X="30" Y="147" Height="10" Width="300" CheckBoxValue="1">
    <Condition Action="enable"><![CDATA[FEATURETWO <> 1 AND FEATURETHREE <> 1]]></Condition>
    <Condition Action="disable">FEATURETWO = 1 OR FEATURETHREE = 1</Condition>
</Control>

如果选择了功能二或三,我想要求核心功能。我可以通过更改功能条件来做到这一点,但是,如果用户取消选中这两个,取消选中 Core,然后重新选中其中一个,我不想安装 Core 功能,即使它的复选框未选中。

如何在禁用CoreFeatureBox 的同时查看它?

【问题讨论】:

    标签: checkbox wix wix3.7


    【解决方案1】:

    要是我再用谷歌搜索几分钟就好了!

    This code 就是我所需要的:

    <Control 
       Id="CB1" 
       Type="CheckBox" 
       Property="myCheckboxResult" 
       CheckBoxValue="my value" 
       Text="Check the box please." 
       X="50" 
       Y="50" 
       Height="10" 
       Width="150">
    
       <Publish Property="myCheckboxResult2" Value="my value" Order="1">myCheckboxResult</Publish>
       <Publish Property="myCheckboxResult2" Value="{}" Order="2">NOT myCheckboxResult</Publish>
       </Control>
    
    <Control 
       Property="myCheckboxResult2" 
       Id="CB2" 
       Type="CheckBox" 
       CheckBoxValue="my value" 
       Text="Check the box please." 
       X="50" 
       Y="70" 
       Height="10" 
       Width="150" />
    

    我在FeatureTwoBox 和FeatureThreeBox 下添加了&lt;Publish/&gt; 节点,一切正常。

    【讨论】:

      猜你喜欢
      • 2023-03-13
      • 2018-04-15
      • 2021-12-23
      • 1970-01-01
      • 2021-08-23
      • 1970-01-01
      • 2020-06-18
      • 1970-01-01
      相关资源
      最近更新 更多