# SetChecked(string, bool)

> Sets the check status of a menu item.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public static void SetChecked(string menuPath, bool isChecked)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)):&#x20;

### Remarks

The check status of a menu item is cleared when the Editor restarts.

### Examples

```csharp
using UnityEditor;
using UnityEngine;

public class CheckMenuTest: MonoBehaviour
{
    // Add a menu item named "MenuTest" to MyMenu in the main menu.    
    [MenuItem("MyMenu/MenuTest")]
    static void DoSomething()
    {
        Debug.Log("A placeholder menu item.");         
    }

    // Add a menu item that you can click to add a check to the "MenuTest" menu item in MyMenu in the main menu. 
    [MenuItem("MyMenu/Check menu item")]
    static void CheckMenu()
    {
        Menu.SetChecked("MyMenu/MenuTest", true);
        Debug.Log("Checked 'MenuTest'");            
    }

    // Add a menu item that you can click to clear the check from the "MenuTest" menu item in MyMenu in the main menu. 
    [MenuItem("MyMenu/Clear check from menu")]
    static void ClearCheck()
    {
        Menu.SetChecked("MyMenu/MenuTest", false);
        Debug.Log("Cleared check from menu");
    }
}
```
