By "all the forms" I assume you mean any child forms of the MDI parent.
If so this is easy. The child windows are available in a property called
MdiChildren[
^], this is just an array of
Form
. Just loop through this array calling each form's
Close()
methods.
You may need to tidy up any resources you have hanging over, hidden MDI childen aren't disposed when they are closed.