How do I set the text of an Edit control when a button is pressed?

ImportantThe following article uses options that are available starting with the Enterprise edition and project type.

Changing or setting a text-field when a button is pressed is a frequent scenario when creating installers. In this article, you will learn how easily this can be done using Advanced Installer.

Store the new text

We will use a property to store the text value you want to use in your Edit Box.

  1. Go to Install Parameters.
  2. Press the "New Property" button from the top-bar.
  3. Create a public property (all letters must be uppercase); for example, we will name it MY_PROP.

Change the Edit Box text

We will use a Push Button with an event attached and an Edit Box to exemplify the scenario.

  1. Go to Dialogs.
  2. Using the Dialogs Toolbox, add an Edit Box which will have the default property name EDIT_1_PROP.
  3. Add a Push Button.
  4. Select the Push Button, and go to its Published Events tab.
  5. Press the New… button to add a new event.
  6. Select “Set Installer property value” from the Properties section of the event.
  7. Set “Property” to the name of the Edit Box property - EDIT_1_PROP.
  8. Set “Argument” to the name of the property the new text is stored - [MY_PROP].

Control event

Now, everytime a user presses the Push Button, the Edit Box’s text will be set to the value of the property created in Install Parameters.