我有 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>