简体   繁体   中英

Using WiX how do I disable/enable controls based on property change?

I'm having a bit of a brain melt at the moment where I have a WiX Combobox and when I change the selection I want to disable/enable other UI controls.

  <ComboBox Property="SQLAUTHTYPE">
    <ListItem Value="WindowsAuth" Text="Windows Authentication" />
    <ListItem Value="SqlAuth" Text="SQL Authentication" />
  </ComboBox>

That is when these events are triggered ...

  MSI (c) ... PROPERTY CHANGE: Modifying SQLAUTHTYPE property. Its current value is 'WindowsAuth'. Its new value: 'SqlAuth'.
  MSI (c) ... PROPERTY CHANGE: Modifying SQLAUTHTYPE property. Its current value is 'SqlAuth'. Its new value: 'WindowsAuth'.

The following UI controls are flagged as disabled when WindowsAuth is selected and enabled when SqlAuth is selected...

  <Control Type="Edit" Width="164" Height="16" X="25" Y="149" Id="SQLAccountTextbox" Property="SQLACCOUNT"
  <Control Type="Edit" Width="164" Height="16" X="190" Y="148" Id="SQLPasswordTextbox" Property="SQLPASSWORD" Password="yes" />

This should do it:

<Control Type="Edit" Width="164" Height="16" X="190" Y="148" Id="SQLPasswordTextbox" Property="SQLPASSWORD" Password="yes">
    <Condition Action="enable">SQLAUTHTYPE = "SqlAuth"</Condition>
    <Condition Action="disable">SQLAUTHTYPE = "WindowsAuth"</Condition>
</Control>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM