I have a form displayed in my app and what I want to do is detect when the user clicks outside of the form and close it, however I am not sure how to do this?

Thanks

Simon