The RigthMouse event will only fire for the form when the mouse pointer is over the form and not one of the controls in the form. If you want rightmouse to close all forms then you must modify all control classes used in forms for their RightMouse event to promote the action top the form as in;