Enable the ShowCloseButton option to display the close button in the main menu.

The close button does not have a default action. Handle the CloseButtonClick event to respond to a click on the button. For instance, you can close the active window.
In an MDI application, this button is hidden when a child form is maximized.