---
title: Register(VisualElement, in TArg)
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/uielements/eventarg1/register
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/uielements/eventarg1/register.md
last_updated: 2026-10-07
generated_at: 2026-11-10T20:11:17.237Z
locale: en-us
---

# Register(VisualElement, in TArg)

> Sets a value for the provided element for this argument identifier. That value can then be retrieved by callbacks that have a second argument of the same type.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/7000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## Register(VisualElement, T)

```csharp
public void Register(VisualElement element, in TArg value)
```

### Parameters

**** (\[VisualElement]\(/engine/7000.0/script-reference/unityengine/uielements/visualelement)): The element to set a value for.**** (T): The value that will be used by callbacks on this element for the provided argument.

### Remarks

If a callback is triggered on an element for which the expected argument value has not been set, that callback will be skipped and a warning will be printed.

Additional Resources: [EventArg\<TArg>.Unregister](/engine/7000.0/script-reference/unityengine/uielements/eventarg1/unregister.md)
