Check if the MaskedEdit control contains text

Hi I am working with wix to create an installation. I need a user dialog so that the user can determine the port. In the dialog box there is a control of type MaskedEdit, where it should write the port. The property associated with the control has a default value. The problem is that when the user clicks the next button, I would like to make sure the port field is relevant or show him a warning. The code for the control is as follows:

<Property Id="DataStoragePort">4323</Property>

  <Dialog Id="DataStoragePortConfig" Width="370" Height="270" Title="CellaVision DM1 Setup">
    <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="Next">
    </Control>
    <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="Back">
    </Control>
    <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
      <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
    </Control>

    <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}Data Storage Configuration" />
    <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="DSDescription" Type="Text" X="20" Y="60" Width="250" Height="13" NoPrefix="yes" Text="Enter the port that the Data Storage Service should run on" />
    <Control Id="DSPort" Type="Text" X="20" Y="80" Width="20" Height="13" NoPrefix="yes" Text="Port:" />
    <Control Id="DSText" Type="MaskedEdit" Text="#####" X="45" Y="78" Width="70" Height="14" Property="DataStoragePort" />
  </Dialog>

and processing the click on the next button is as follows:

      <Publish Dialog="DataStoragePortConfig" Control="Back" Event="NewDialog" Value="CustomizeDlg">1</Publish>
  <Publish Dialog="DataStoragePortConfig" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>

but on the next click, I would like to make sure that the DataStoragePort property is not an empty string. Any suggestions? Regards Daniel

+3
1

"#" "?". , "" "#####",

"     "
"" "### - ###",
"   -   "

:

DataStoragePort <> "     "
+2

Source: https://habr.com/ru/post/1780229/


All Articles