Why not remove it from the Form, that way you don't have
to deal with this, and instead, put a "Close" button on
the Form.
In the Form property, set the "Close Button" property
to "No", that way it will be disabled. The way to
completely remove it is to set the "Control Box" to "No"