WIX 单选按钮组 [英] WIX radio button group

查看:23
本文介绍了WIX 单选按钮组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在做 WIX 单选组按钮,我想知道

I am stuck in doing with WIX radio group button,I want to know

  1. 我是否可以根据下图中提到的 WIX 单选组按钮的选择禁用文本框.

  1. Whether i can able to disable text box based on selection of WIX radio group button like mentioned in the image below.

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

And how is it possible to save selection of radio group button value.As i needed the selected radio box value and save in registry.

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

for registry is it possible to assign the 1st text box value based on this condition?

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

谁能帮帮我.

推荐答案

假设您的单选按钮如下:

Assuming you have your Radio Button as following:

<RadioButtonGroup Property="SOME_PROPERTY">
    <RadioButton Value="0" Text="disable / hide labels" />
    <RadioButton Value="1" Text="enable / show labels" />
</RadioButtonGroup>

您可以使用 Condition 子元素来控制对话框中其他元素的可见性或可用性:

you can control visibility or availablility of other elements in the dialog by using Condition sub-element:

<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 元素值更新属性的示例(为了清楚起见,省略了一些必需的控件属性):

Following the request in comments, posting an example of updating property with values of Edit elements (some required control attributes are ommited for clarity):

<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 单选按钮组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆