我有2个编辑控件。如何验证非空字符串。 下面是我使用的wix文件。我想要禁用PushButton,直到有WIXUI_AGENTIP和WIXUI_AGENTPORT的值。
<Dialog Id="MyInstallDirDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgTitle)" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="15" NoPrefix="yes" Text="!(loc.InstallDirDlgFolderLabel)" />
<Control Id="Folder" Type="PathEdit" X="20" Y="80" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="100" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
<Control Id="IPAddressLabel" Type="Text" X="20" Y="130" Width="200" Height="15" TabSkip="no" Text="HostName/IP Address of Server:" />
<Control Id="IPAddressEdit" Type="Edit" X="20" Y="140" Width="220" Height="18" Property="WIXUI_AGENTIP" Text="Enter HostName/IP Address Here" />
<!-- port -->
<Control Id="SQLPortLabel" Type="Text" X="20" Y="160" Width="160" Height="15" TabSkip="no" Text="Port for Sentinel Syslog Server:" />
<Control Id="DomainPoolEdit" Type="Edit" X="20" Y="170" Width="220" Height="18" Property="WIXUI_AGENTPORT" Text="Port Number Here" />
</Dialog>
答案 0 :(得分:0)
我想出了自己。
<Dialog Id="MyDlg_Error" Width="260" Height="85" NoMinimize="yes" Title="!(loc.InvalidTextTile)">
<Control Id="MyDlgSkipDesc" Type="Text" Width="194" X="48" Y="15" Height="30" Text="!(loc.InvalidTextDesc)" />
<Control Id="warningIcon" Type="Icon" X="15" Y="15" Width="24" Height="24"
ToolTip="Information icon" FixedSize="yes" IconSize="32" Text="warning.ico" />
<Control Id="Ok" Type="PushButton" X="97" Y="57" Width="66" Height="17" Text="!(loc.InvalidTextOK)" />
</Dialog>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="SpawnDialog" Value="MyDlg_Error" Order="5"><![CDATA[Not (WIXUI_SQLAGENTIP <> "" AND WIXUI_SQLAGENTPORT <> "")]]></Publish>