Step 3. Using Component Properties

1.  Drag a Check box onto the left hand column. Select the Details tab. Note it is automatically named Checkbox1.

2.  On the Layout ribbon, change Alignment to Top Left and Flow to Down.

a.  Change margin Left to 20 and margin Top to 20.

b.  On the Details tab, set up the Check box properties as follows:

Property

Value

Caption

Allow Uppercase and Reverse

ButtonState

Checked

Width

220

 

     Your design should now look like the following:

4.  Change the STD_TEXT.Changed event to execute the Assign command, if the check box's ButtonState is Checked. Your code should look like the following:

Evtroutine Handling(#STD_TEXT.Changed)

If Cond(#CheckBox1.ButtonState = Checked)

#STD_DESCL := #STD_TEXT.UpperCase.Reverse

Endif

Endroutine

 

     Your IF expression is a Boolean expression which 'GETS' the property ButtonState for component Checkbox1.

5.  Compile and test your web page. The results field will not be populated if the Check box is unchecked.

     Note: If the web page is still open in the browser, you can reload the page to run the updated version. Just press Enter on the URL in the address bar, use the browser Refresh button or press F5.

6.  In the Design view select the Clear button and change its Enabled property to False. The Clear button will now be initially disabled.

7.  Make the following change to your web page logic:

a.  Change the HELLO.Click event to SET the Clear button to Enabled=True

b.  Change the WORLD.Click event to SET the Clear button to Enabled=True

c.  Change the STD_TEXT.Changed event to SET the Clear button to Enabled=True

d.  Change the CLEAR.Click event to SET the Clear button to Enabled=False

     For example the HELLO.Click event would look like the following:

Evtroutine Handling(#HELLO.Click)

#STD_TEXT := #STD_TEXT + 'Hello '

#CLEAR.Enabled := true

Endroutine

 

     The above statement uses the ASSIGN statement to SET the CLEAR button's Enabled property.

     A longer form could use the SET statement:

SET Com(#CLEAR) Enabled(true)

 

8.  Compile and test your web page. The Clear button should be initially disabled. The Clear button should be enabled whenever the Hello or World buttons are used, or when text is typed into the "Enter some text" field.