使用WIX通过自定义操作设置编辑控件文本值 [英] Set edit control text value from custom action with WIX

查看:251
本文介绍了使用WIX通过自定义操作设置编辑控件文本值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过C#自定义操作更改 edit < Control /> 的文本值?

How can I change text value of an "edit" <Control /> from a C# custom action?

我可以填充 combobox控件,但找不到改变 edit控件值的方法。

I can populate a "combobox" control but I can't find a way to change an "edit" control value.

推荐答案

如果要处理文件浏览器对话框或文件夹浏览器对话框(同样适用于您的情况),请在执行自定义操作后发布更改的属性。最好,如果您在调用自定义操作之前进行了重置。请参见下面的示例

If you are dealing with a file browser dialog or folder browser dialog (Will work for your case as well), publish the changed property after executing the custom action. Best if you reset before calling the custom action. See following example

  <Control Id="editLocation"  Type="Edit" X="45" Y="174" Height="18" Width="220" Property="YOUR_PROPERTY" Text="[YOUR_PROPERTY]"/>
  <Control Id="btnEditLocation" Type="PushButton" X="270" Y="175" Width="56" Height="17" Text="Browse" Property="YOUR_PROPERTY">
  <Publish Event="Reset" Value="1">1</Publish>             
  <Publish Event="DoAction" Value="YOUR_CUSTOM_ACTION"><![CDATA[1]]></Publish>
  <Publish Property="YOUR_PROPERTY" Value="[YOUR_PROPERTY]"><![CDATA[1]]></Publish>
  </Control>

这篇关于使用WIX通过自定义操作设置编辑控件文本值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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