WIX UI-创建“密码不匹配”标签 [英] WIX UI - Creating a "passwords don't match" label

查看:81
本文介绍了WIX UI-创建“密码不匹配”标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要安装程序接受密码,因此我创建了一个对话框,提示用户两次输入密码(以避免输入错误),但是我在获取您的密码不正确方面遇到了一些麻烦t匹配标签会在正确的时间出现和消失。



这是我到目前为止的内容:

 <控制Id =密码 Type =编辑属性= VDIR_PASSWORD密码=是 /> 
< Control Id = ConfirmPassword Type = Edit Property = ConfirmPassword Password = yes />
< Control Id = PasswordMismatchLabel Type =文本 Text =密码不匹配。>
< Condition Action = hide> VDIR_PASSWORD = ConfirmPassword< / Condition>
< / Control>

这可以编译,但是标签从不显示。 (如果我反转条件,则标签会显示,但如果不匹配,标签不会消失)。



我可以看到我缺少的东西是订阅某个事件,该事件在发生任何事情时(例如,用户按下键,或者从任何一个控件失去焦点)都会更新标签,但是我找不到任何文档或如何实现此目的的示例。 / p>

是否可以这样做?

解决方案

WiX只能执行基础技术(Windows Installer)可以执行的操作。与我们都习惯的普通桌面应用程序相比,Windows Installer的UI较差。因此,回答您的问题:不,您不能基于在密码字段中输入的值来显示/隐藏标签。至少,我不知道支持的方法。



但是,您可以执行以下操作。删除该标签,然后将条件添加到该对话框的下一步按钮。如果密码匹配,请移至链中的下一个对话框。否则,显示一个消息框,提示密码不匹配,并停留在当前对话框中,直到用户正确填写为止。



希望这会有所帮助。


I need my installer to accept a password, and so I've created a dialog on which users are prompted to enter their passwords twice (to avoid mistakes), however I'm having some trouble getting my "Your passwords don't match" label to appear and disappear at the correct times.

This is what I have so far:

<Control Id="Password" Type="Edit" Property="VDIR_PASSWORD" Password="yes" />
<Control Id="ConfirmPassword" Type="Edit" Property="ConfirmPassword" Password="yes" />
<Control Id="PasswordMismatchLabel" Type="Text" Text="Passwords do not match.">
  <Condition Action="hide">VDIR_PASSWORD = ConfirmPassword</Condition>
</Control>

This compiles, however does the label never shows. (if I reverse the condition then the label shows, but doesn't disappear if they don't match).

I can see that the thing I'm missing is subscription to some event that updates the label whenever something happens (e.g. the user presses a key, or focus is lost from either of the controls), however I'm not able to find any documentation or examples of how I might achieve this.

Is it possible to do this?

解决方案

WiX can only do what underlying technology (Windows Installer) can. Windows Installer has poor UI comparing to usual desktop applications we all used to. So, answering your question: no, you can't show/hide the label based on the value you've typed into the password field. At least, I'm not aware about a supported way.

However, you can do the following. Drop that label, and instead add a condition to the Next button of this dialog. If passwords match, move to the next dialog in the chain. Otherwise, show a message box saying "password don't match" and stay on the current dialog until the user fills it in correctly.

Hope this helps.

这篇关于WIX UI-创建“密码不匹配”标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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