# ToggleButtonGroupState

> The structure that keeps track of the Button states inside a ToggleButtonGroup.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.UIElements](/engine/6000.7/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule
* **Implements:** [IEquatable\<ToggleButtonGroupState>](https://learn.microsoft.com/dotnet/api/system.iequatable-1), [IComparable\<ToggleButtonGroupState>](https://learn.microsoft.com/dotnet/api/system.icomparable-1)

```csharp
public struct ToggleButtonGroupState : IEquatable<ToggleButtonGroupState>, IComparable<ToggleButtonGroupState>
```

## Remarks

To set properties on how to serialize this type, use [ToggleButtonGroupStatePropertiesAttribute](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstatepropertiesattribute.md).

## Constructors

| Constructor                                                                                                                                 | Description                          |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| [ToggleButtonGroupState(System.UInt64,System.Int32)](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/ctor.md) | Constructs a ToggleButtonGroupState. |

## Properties

| Property                                                                                          | Description                                            |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| [this\[\]](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/item.md) | The option based on the index.                         |
| [length](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/length.md) | Returns the number of toggle button options available. |

## Methods

| Method                                                                                                                    | Description                                                              |
| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [CompareTo](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/compareto.md)                   | Compares two ToggleButtonGroupState.                                     |
| [Equals](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/equals.md)                         | Compares the the current option set with an Object.                      |
| [GetActiveOptions](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/getactiveoptions.md)     | Retrieves a Span of integers containing the active options as indices.   |
| [GetHashCode](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/gethashcode.md)               | Get the hashcode of this ToggleButtonGroupState.                         |
| [GetInactiveOptions](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/getinactiveoptions.md) | Retrieves a Span of integers containing the inactive options as indices. |
| [ResetAllOptions](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/resetalloptions.md)       | Resets the states of the toggle buttons.                                 |
| [SetAllOptions](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/setalloptions.md)           | Sets all the available options to active.                                |
| [ToggleAllOptions](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/togglealloptions.md)     | Toggles all the available options' state.                                |

## Static Methods

| Method                                                                                                                  | Description                                                                           |
| ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [Compare](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/compare.md)                     | Compares two ToggleButtonGroupState of flag enum types.                               |
| [CreateFromOptions](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/createfromoptions.md) | Helps generate a ToggleButtonGroupState based on a list of booleans.                  |
| [FromEnumFlags](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/fromenumflags.md)         | Creates a ToggleButtonGroupState based on a FlagsAttribute enum type.                 |
| [ToEnumFlags](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/toenumflags.md)             | Synchronizes the internal data with the ToggleButtonGroupState from a FlagsAttribute. |

## Operators

| Operator                                                                                                      | Description                                                    |
| ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [operator ==](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/op-equality.md)   | Checks if both of the ToggleButtonGroupState are the same.     |
| [operator !=](/engine/6000.7/script-reference/unityengine/uielements/togglebuttongroupstate/op-inequality.md) | Checks if both of the ToggleButtonGroupState are not the same. |
