如何通过间接 属性 使用 RadioButtonGroup 控件?
How to Use RadioButtonGroup Control with Indirect Property?
我正在开发一个使用 WIX 工具集的安装程序,它有一个对话框,它从用户那里获取一些输入并将它们传递给父对话框。对于 POC,我为 Edit Control 做了这件事,效果很好。
但是当我尝试使用 RadioButtonGroup 时,它失败了
Unresolved reference to symbol 'Property:_TestRb' in section 'Fragment:'.(LGHT0094)
下面是我的父对话框
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<DialogRef Id="spandlg"></DialogRef>
<Property Id="TestProp" Value="Test"></Property>
<Property Id="TestRadio" Value="1"></Property>
<Dialog Id="parent_dlg" Width="370" Height="270" Title="parent.dlg">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="Next">
<Publish Property="_TestRb" Value="TestRadio" Order="2">1</Publish>
<Publish Property="_TestP" Value="TestProp" Order="1">1</Publish>
<Publish Event="SpawnDialog" Value="spandlg" Order="3">1</Publish>
</Control>
<Control Id="txtBox" Type="Edit" Height="15" Width="321" X="10" Y="16" Property="TestRadio"></Control>
<Control Id="txtBox1" Type="Edit" Height="15" Width="321" X="10" Y="50" Property="TestProp"></Control>
<Control Id="c" Type="PushButton" X="300" Y="243" Width="56" Height="17" Default="yes" Text="Cancel">
<Publish Event="EndDialog" Value="Exit" Order="2">1</Publish>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
这是将作为 Spawn 打开的对话框
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="spandlg" Width="370" Height="270" Title="spandlg">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="[Button_Next]">
<Publish Event="EndDialog" Value="Return"></Publish>
</Control>
<Control Id="textBox1" Type="Edit" Height="15" Width="176" X="9" Y="9" Property="_TestP" Indirect="yes" />
<Control Id="radioButtonGroupBox1" Type="RadioButtonGroup" Height="75" Width="150" X="10" Y="36"
Property="_TestRb" Indirect="yes" >
<RadioButtonGroup Property="_TestRb">
<RadioButton X="3" Y="26" Height="18" Width="78" Text="radioButton2" Value="0" />
<RadioButton X="3" Y="3" Height="18" Width="78" Text="radioButton1" Value="1" />
</RadioButtonGroup>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
我不知道代码有什么问题。
您应该在某处定义 属性。像
<Property Id="_TestRb" />
也许您交换了 属性 和值属性?
删除后我能够解决问题,
<Control Id="txtBox" Type="Edit" Height="15" Width="321" X="10" Y="16" Property="TestRadio"></Control>
来自 parent_dlg 对话框。
看起来,因为 Edit Control 可以更改 属性 TestRadio 的值,而 0
和 1
是无效的ICE34。但是错误消息 Unresolved reference to symbol 'Property:_TestRb' in section 'Fragment:'
一点帮助都没有。
在定义 属性 _TestRb 后显示实际错误 ICE34: 1 is not a valid default value for the property TestRadio. The property is an indirect RadioButtonGroup property of control spandlg.radioButtonGroupBox1 (via property _TestRb). (LGHT0204)
.
我正在开发一个使用 WIX 工具集的安装程序,它有一个对话框,它从用户那里获取一些输入并将它们传递给父对话框。对于 POC,我为 Edit Control 做了这件事,效果很好。 但是当我尝试使用 RadioButtonGroup 时,它失败了
Unresolved reference to symbol 'Property:_TestRb' in section 'Fragment:'.(LGHT0094)
下面是我的父对话框
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<DialogRef Id="spandlg"></DialogRef>
<Property Id="TestProp" Value="Test"></Property>
<Property Id="TestRadio" Value="1"></Property>
<Dialog Id="parent_dlg" Width="370" Height="270" Title="parent.dlg">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="Next">
<Publish Property="_TestRb" Value="TestRadio" Order="2">1</Publish>
<Publish Property="_TestP" Value="TestProp" Order="1">1</Publish>
<Publish Event="SpawnDialog" Value="spandlg" Order="3">1</Publish>
</Control>
<Control Id="txtBox" Type="Edit" Height="15" Width="321" X="10" Y="16" Property="TestRadio"></Control>
<Control Id="txtBox1" Type="Edit" Height="15" Width="321" X="10" Y="50" Property="TestProp"></Control>
<Control Id="c" Type="PushButton" X="300" Y="243" Width="56" Height="17" Default="yes" Text="Cancel">
<Publish Event="EndDialog" Value="Exit" Order="2">1</Publish>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
这是将作为 Spawn 打开的对话框
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="spandlg" Width="370" Height="270" Title="spandlg">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="[Button_Next]">
<Publish Event="EndDialog" Value="Return"></Publish>
</Control>
<Control Id="textBox1" Type="Edit" Height="15" Width="176" X="9" Y="9" Property="_TestP" Indirect="yes" />
<Control Id="radioButtonGroupBox1" Type="RadioButtonGroup" Height="75" Width="150" X="10" Y="36"
Property="_TestRb" Indirect="yes" >
<RadioButtonGroup Property="_TestRb">
<RadioButton X="3" Y="26" Height="18" Width="78" Text="radioButton2" Value="0" />
<RadioButton X="3" Y="3" Height="18" Width="78" Text="radioButton1" Value="1" />
</RadioButtonGroup>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
我不知道代码有什么问题。
您应该在某处定义 属性。像
<Property Id="_TestRb" />
也许您交换了 属性 和值属性?
删除后我能够解决问题,
<Control Id="txtBox" Type="Edit" Height="15" Width="321" X="10" Y="16" Property="TestRadio"></Control>
来自 parent_dlg 对话框。
看起来,因为 Edit Control 可以更改 属性 TestRadio 的值,而 0
和 1
是无效的ICE34。但是错误消息 Unresolved reference to symbol 'Property:_TestRb' in section 'Fragment:'
一点帮助都没有。
在定义 属性 _TestRb 后显示实际错误 ICE34: 1 is not a valid default value for the property TestRadio. The property is an indirect RadioButtonGroup property of control spandlg.radioButtonGroupBox1 (via property _TestRb). (LGHT0204)
.