# Automatic Closing

## Content



By default, the menu and the submenus close when a user clicks outside of the menu. However, you can change this behavior by disabling the automatic closing feature, which allows to keep menus open even when the user clicks outside the menu control's boundaries. To turn off the automatic closing, you need to set the [AutoClose](/componentone/api/winui/online-winui/dotnet-api/C1.WinUI.Menu/C1.WinUI.Menu.C1MenuList.AutoClose.html) property to **False**.

The following GIFs display the default behavior, i.e., automatic closing of menu when the user clicks outside of the menu and the behavior of menu when the **AutoClose** property is set to **False** explicitly.

| **Automatic Closing(Default Behavior)** | **Without Automatic Closing** |
| --- | --- |
| ![Menu auto closing behavior](https://cdn.mescius.io/document-site-files/images/2d49eac2-0942-4770-99ef-52b14e6815bd/images/menu-auto-closing.gif) | ![Menu without auto closing behavior](https://cdn.mescius.io/document-site-files/images/2d49eac2-0942-4770-99ef-52b14e6815bd/images/menu-no-auto-closing.gif) |

To disable automatic closing of the menu when the user clicks outside of it, use the following code:

```xml
<c1:C1Menu x:Name="WordMenu" AutoClose="False" Orientation="Horizontal" VerticalAlignment="Top"></c1:C1Menu>
```