# Highlight

> Highlights an element in the editor.

## Definition

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

## Highlight(string, string)

Highlights an element in the editor.

```csharp
public static bool Highlight(string windowTitle, string text)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The title of the window the element is inside.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The text to identify the element with.

### Returns

| Type                                                          | Description                                                 |
| ------------------------------------------------------------- | ----------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true if the requested element was found; otherwise `false`. |

### Remarks

This function will highlight the specified element in the specified window. If the element could not be found, the function returns false. If the element is inside a scrollview and is not currently visible, the scrollview will first automatically scroll to reveal the element and then highlight it.

Once the element is highlighted it will stay highlighted until either the [Highlighter.Stop](/engine/6000.3/script-reference/unityeditor/highlighter/stop.md) function is called, or the element disappears from view. The element could disappear from view if the user scrolls away from it, the window is closed, the section of the GUI with the element in it is collapsed or otherwise hidden, or when starting or stopping Play Mode.

Most EditorGUI controls can be highlighted using their label as identifier.

Any control that uses the [SerializedProperty](/engine/6000.3/script-reference/unityeditor/serializedproperty.md) system can be highlighted using its [SerializedProperty.propertyPath](/engine/6000.3/script-reference/unityeditor/serializedproperty/propertypath.md).

Any element with text in it can be highlighted using that text as identifier, which is for example useful for buttons.

See the [HighlightSearchMode](/engine/6000.3/script-reference/unityeditor/highlightsearchmode.md) enum for more details on identifying elements.

Additional Resources: [Highlighter.Stop](/engine/6000.3/script-reference/unityeditor/highlighter/stop.md), [Highlighter.HighlightIdentifier](/engine/6000.3/script-reference/unityeditor/highlighter/highlightidentifier.md).

## Highlight(string, string, HighlightSearchMode)

Highlights an element in the editor.

```csharp
public static bool Highlight(string windowTitle, string text, HighlightSearchMode mode)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The title of the window the element is inside.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The text to identify the element with.**** (\[HighlightSearchMode]\(/engine/6000.3/script-reference/unityeditor/highlightsearchmode)): Optional mode to specify how to search for the element.

### Returns

| Type                                                          | Description                                                 |
| ------------------------------------------------------------- | ----------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | true if the requested element was found; otherwise `false`. |

### Remarks

This function will highlight the specified element in the specified window. If the element could not be found, the function returns false. If the element is inside a scrollview and is not currently visible, the scrollview will first automatically scroll to reveal the element and then highlight it.

Once the element is highlighted it will stay highlighted until either the [Highlighter.Stop](/engine/6000.3/script-reference/unityeditor/highlighter/stop.md) function is called, or the element disappears from view. The element could disappear from view if the user scrolls away from it, the window is closed, the section of the GUI with the element in it is collapsed or otherwise hidden, or when starting or stopping Play Mode.

Most EditorGUI controls can be highlighted using their label as identifier.

Any control that uses the [SerializedProperty](/engine/6000.3/script-reference/unityeditor/serializedproperty.md) system can be highlighted using its [SerializedProperty.propertyPath](/engine/6000.3/script-reference/unityeditor/serializedproperty/propertypath.md).

Any element with text in it can be highlighted using that text as identifier, which is for example useful for buttons.

See the [HighlightSearchMode](/engine/6000.3/script-reference/unityeditor/highlightsearchmode.md) enum for more details on identifying elements.

Additional Resources: [Highlighter.Stop](/engine/6000.3/script-reference/unityeditor/highlighter/stop.md), [Highlighter.HighlightIdentifier](/engine/6000.3/script-reference/unityeditor/highlighter/highlightidentifier.md).
