# TrackedChangeCollection.GetEnumerator Method

> Returns an enumerator that can be used to iterate through the collection.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > TrackedChangeCollection.GetEnumerator Method
- **565 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/trackedchangecollection/getenumerator-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/trackedchangecollection/getenumerator-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/trackedchangecollection/getenumerator-method/llms-full.txt

---

### Description

Returns an enumerator that can be used to iterate through the collection.

### Syntax

```csharp
public TrackedChangeCollection.TrackedChangeEnumerator GetEnumerator();
```

```vbnet
Public Function GetEnumerator() As TrackedChangeCollection.TrackedChangeEnumerator
```

### Return Value

The return value is an IEnumerator that represents the collection.

### Examples

The following example explicitly enumerates revisions and selects the first insertion.

```csharp
TrackedChangeCollection changes = textControl.TrackedChanges;
IEnumerator enumerator = changes.GetEnumerator();
while (enumerator.MoveNext())
{
    TrackedChange change = (TrackedChange)enumerator.Current;
    if (change.ChangeKind == ChangeKind.InsertedText)
    {
        change.Select();
        break;
    }
}
```

```vbnet
Dim changes As TrackedChangeCollection = textControl.TrackedChanges
Dim enumerator As IEnumerator = changes.GetEnumerator()
While enumerator.MoveNext()
    Dim change As TrackedChange = DirectCast(enumerator.Current, TrackedChange)
    If change.ChangeKind = ChangeKind.InsertedText Then
        change.Select()
        Exit While
    End If
End While
```

---

## Nearby

- **Previous:** [TrackedChangeCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/trackedchangecollection/count-property/llms-full.txt)
- **Next:** [TrackedChangeCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/trackedchangecollection/getitem-method/llms-full.txt)
