gpt4 book ai didi

WIX 单选按钮组

转载 作者:行者123 更新时间:2023-12-02 02:39:15 30 4
gpt4 key购买 nike

我陷入了使用WIX单选组按钮的困境,我想知道

  1. 我是否可以根据选择 WIX 单选组按钮来禁用文本框,如下图所示。

  2. 如何保存对单选组按钮值的选择。因为我需要选定的单选框值并保存在注册表中。

对于注册表,是否可以根据此条件分配第一个文本框值?

<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>

谁能帮帮我。

WIX Radio group button

最佳答案

假设您的单选按钮如下:

<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>

根据评论中的请求,发布一个使用 Edit 元素的值更新属性的示例(为了清楚起见,省略了一些必需的控件属性):

<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>

关于WIX 单选按钮组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17198443/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com