Publish element
To trigger an event, nest a Publish
element inside a Control
element. For example, to cause a PushButton
control to open a new modal window, add a Publish
element inside it that specifies the SpawnDialog
event with its Event
attribute, as in the following snippet:
<Control Id="ShowPopupButton" Type="PushButton" Text="Show Popup" Height="17" Width="56" X="245" Y="243" Default="yes"> <Publish Event="SpawnDialog" Value="PopupDlg">1</Publish> </Control>
You'll find that different events require different arguments in the Value
attribute. Here, Value
takes the Id
of the Dialog
element you want to open. Also, notice that we've used a conditional statement as the inner text of the Publish
element. Setting it to 1
means that it will always be true and always trigger the event. However, you can also test that a property, perhaps set by another control event or a custom action, evaluates...