When at least one property value has changed, the WriteProperties event occurs immediately before the UserControl’s Terminate event. This allows a property value to be saved just before an instance of a UserControl is destroyed. To save a property value, the WriteProperty method of the PropertyBag object is used.