<doc>
  <legacy_id>3523</legacy_id>
  <name>closeControl</name>
  <type>message</type>
  <syntax>
    <example>closeControl</example>
  </syntax>
  <library></library>
  <objects>
    <group/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Writing LiveCode</category>
  </classification>
  <references>
    <command tag="dispatch">dispatch Command</command>
    <message tag="openControl">openControl Message</message>
  </references>
  <history>
    <introduced version="3.5">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Sent to a <object tag="group">group</object> when the user is leaving the <object tag="card">card</object> that contains it.</summary>
  <examples>
    <example>on closeControl</p><p>  deleteTemporaryObjects</p><p>  pass closeBackground</p><p>end closeControl</example>
  </examples>
  <description>
    <p>Handle the <b>closeControl</b> message if you want to perform clean-up or do other tasks when the user leaves a card.</p><p/><p><b>Comments:</b></p><p>A <object tag="group">group</object> is closed when the user either goes to a card that doesn't have the group on it, or closes the stack. Groups with their <property tag="backgroundBehavior">backgroundBehavior property</property> set to true are sent the message when the user goes to a card that the group is not placed on from one where it is, as well as when the stack is closed.</p><p/><p>The <b>closeControl</b> message is sent to groups just before the <message tag="closeCard">closeCard message</message> is sent to the <object tag="card">card</object> being closed. For nested groups it is sent to the parent group first, then if passed or not handled, it passes through each child group in reverse layer order (from highest to lowest).</p><p/><p>For groups with their <property tag="backgroundBehavior">backgroundBehavior property</property> set to true, the <b>closeControl</b> message is sent after the <message tag="closeCard">closeCard message</message>, and just before the <message tag="closeBackground">closeBackground message</message>.</p><p/><p>The actual closing is not triggered by the <b>closeControl</b> message, so blocking it will not stop the card being closed.</p>
  </description>
</doc>