The following code example is a method that is executed when the Click event occurs. The Shape class has several methods with the name pattern OnEventName that execute methods when the EventName event occurs. (EventName represents the name of the corresponding event.)