调用托管操作后如何与控件属性进行交互? [英] How to interact with control properties after a call to a managed action?

查看:66
本文介绍了调用托管操作后如何与控件属性进行交互?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个托管操作,当按下一个按钮时,它会返回bool.

I have a managed action with returns bool when a button is pressed.

取决于是否返回true/false,我希望能够更改对话框上控件的属性.不仅仅限于文本值.

Depending on if true / false is returned I want to be able to change the properties of controls on the dialog. Not limited to just the text value.

这是否可行,例如可见性等?

Is this possible, for example the visibility, etc?

推荐答案

这是可能的,但是您必须确保有一个设置属性控制事件(在您的托管代码自定义操作do-event之后).与您要更新UI的任何内容有关的属性.如果您在托管代码中或通过InstallShield提供的包装更改属性值,则Windows Installer UI不会跟踪更改并进行更新.

It is possible, however you will have to make sure there is a set-property control event (after your managed code custom action do-event) that touches a property related to anything you want the UI to update. If you change a property value within the managed code, or via the wrapper InstallShield provides, the Windows Installer UI doesn't track the change and update in response.

例如,您可以将返回值连接到属性RETURNVALUE,然后添加一个控件事件,该事件设置更好的命名属性,例如MYCONTROLTEXT或SHOWMYCONTROL;控件或其条件将与那些命名更好的属性关联.

So, for example, you could wire your return value to the property RETURNVALUE, and then add a control event that sets better named properties like MYCONTROLTEXT or SHOWMYCONTROL; the control or its conditions would be wired to those better named properties.

这篇关于调用托管操作后如何与控件属性进行交互?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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