CodeCharge Studio

Adding an Action to the Label

Now that you created the label control, it is time to assign a value that will be shown by this label. To do so, we will need to use some programming code that assigns specific text to the label's value.

Luckily in CodeCharge Studio you can utilize "actions" to automatically generate several lines of code without programming. Actions are usually used for small tasks, such as sending an email, validating data entry, reading or saving a cookie, etc. In this example we will use the "Retrieve Value for Control" action to set the label's value to the plain text "Hello World!".

To assign Hello World! to the Label use the Before Show event using the Retrieve Value for Control action:

  1. Switch to Events tab of the Properties.
  2. Right-click on the Before Show and select the Add Action... option.
  3. Select Retrieve Value for Control from the list.
  4. Click Ok.

To configure the action properties:

  1. Select Retrieve Value for Control action in Events tab.
  2. Set MyLabel in the Control Name property.
  3. Select Expression in the Source Type property.
  4. Set "Hello World!" in the Source Name property.

Next: Previewing the Code


On-line, printable versions and updates