# FromEnumFlags<T>(T, int)

> Creates a ToggleButtonGroupState based on a FlagsAttribute enum type.

## Definition

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

```csharp
public static ToggleButtonGroupState FromEnumFlags<T>(T options, int length = -1) where T : Enum
```

### Parameters

**** (T): The default Enum Flag value.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of options.

### Returns

| Type                                                                                                       | Description                                                           |
| ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| [ToggleButtonGroupState](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate.md) | A ToggleButtonGroupState based on the EnumFlag passed as an argument. |
