3. After studying Lesson C, you should
be able to:
● • Include a static variable in code
● Code the TextChanged event procedure
● Create a procedure that handles more than one event
3
6. Coding the TextChanged Event Procedure
● TextChanged event
○ Occurs when the Text property value of a control
changes
6
7. Coding the TextChanged Event Procedure
(cont.)
● Can occur
○ The use enters data into the control
○ The code assigns data to the control’s Text
Property
● Example: A change is made to the number of items
ordered
7
8. Associating a Procedure with Different Objects
and Events
● Handles clause
○ Appears in an event procedure’s header
○ Indicates the object and event associated with
the procedure
8
9. Associating a Procedure with Different Objects and
Events (cont.)
● You can associate an event procedure with more
than or object and/ or event
○ In the Handles section of procedure header, list
each and event separated by commas
9
10. Associating a Procedure with Different Objects
and Events
● Procedure names are entered in Pascal case
○ Capitalize the first letter in the name and the first
letter of each subsequent word in the name
10
13. Lesson C Summary
● To process code when a change is made to the
contents of a control’s Text property:
○ Enter the code in the control’s TextChanged
event procedure.
13
14. Lesson C, Summary
● To associate a procedure with more than one object
or event:
○ List each object and event (using the syntax
object.event) after the Handles keyword in the
procedure header. Use a comma to separate an object
and event from the previous object and event.
14