我无法使用WIX电台组按钮,我想知道
我能否根据下图所示的WIX广播组按钮选择禁用文本框。
如何保存无线电组按钮值的选择。因为我需要选中的无线电盒值并保存在注册表中。
注册表是否可以根据此条件分配第一个文本框值?
<Condition><![CDATA[if (RADIOGROUP=1)<Property Id="RADIOGROUP" Value="[TEXTBOX1]" />]]></Condition>
<RegistryKey Root="HKLM" Key="SOFTWARE\Company\Service" >
<RegistryValue Name="RADIOGROUP" Value="[RADIOGROUP]" Type="string" >
</RegistryKey>
任何人都可以帮助我。
答案 0 :(得分:10)
假设您的单选按钮如下:
<RadioButtonGroup Property="SOME_PROPERTY">
<RadioButton Value="0" Text="disable / hide labels" />
<RadioButton Value="1" Text="enable / show labels" />
</RadioButtonGroup>
您可以使用Condition
子元素控制对话框中其他元素的可见性或可用性:
<Control Id="SomeLabel" Type="Text" Text="text:">
<Condition Action="disable"><![CDATA[SOME_PROPERTY <> "1"]]></Condition>
<Condition Action="enable"><![CDATA[SOME_PROPERTY = "1"]]></Condition>
</Control>
<Control Id="SomeLabel2" Type="Text" Text="text2:">
<Condition Action="hide">SOME_PROPERTY = "0"></Condition>
<Condition Action="show">SOME_PROPERTY = "1"></Condition>
</Control>
在评论中发出请求后,发布一个使用编辑元素值更新属性的示例(为了清楚起见,省略了一些必需的控制属性):
<CustomAction Id="CA_SET_TO_A" Property="P" Value="[AA]" />
<CustomAction Id="CA_SET_TO_B" Property="P" Value="[BB]" />
<Dialog Id="MyDialog" Title="[ProductName] Setup">
<Control Id="Next" Type="PushButton" Default="yes" Text="!(loc.WixUINext)">
<Publish Event="DoAction" Value="CA_SET_TO_A">R="USE_A"</Publish>
<Publish Event="DoAction" Value="CA_SET_TO_B">R="USE_B"</Publish>
</Control>
<Control Id="MyRadioButton" Type="RadioButtonGroup" Property="R">
<RadioButtonGroup Property="R">
<RadioButton Value="USE_A" Text="Save text field 1" />
<RadioButton Value="USE_B" Text="Save text field 2" />
</RadioButtonGroup>
</Control>
<Control Id="A" Type="Edit" Property="AA" Text="{64}">
<Condition Action="disable">R="USE_B"</Condition>
<Condition Action="enable">R="USE_A"</Condition>
</Control>
<Control Id="B" Type="Edit" Property="BB" Text="{64}">
<Condition Action="disable">R="USE_A"</Condition>
<Condition Action="enable">R="USE_B"</Condition>
</Control>
</Dialog>