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

GetEnumerator()

public IEnumerator GetEnumerator();
Public Function GetEnumerator() As IEnumerator

Return Value

The return value is an IEnumerator that represents the collection.

Examples

The following code removes all TextFields using an enumerator.

TXTextControl.TextFieldCollection.TextFieldEnumerator tfEnum = textControl1.TextFields.GetEnumerator();
int tfCounter = textControl1.TextFields.Count;
//set enum to first field
tfEnum.MoveNext();
for (int i = 0; i < tfCounter; i++)
    {
        //get first field
        TXTextControl.TextField currField = (TXTextControl.TextField)tfEnum.Current;
        //set enum to the next field
        tfEnum.MoveNext();
        Console.WriteLine("start: " + currField.Start);
        //remove the current field
        textControl1.TextFields.Remove(currField);
    }
Dim tfEnum As TXTextControl.TextFieldCollection.TextFieldEnumerator = textControl1.TextFields.GetEnumerator
Dim tfCounter As Integer = textControl1.TextFields.Count
'set enum to first field
tfEnum.MoveNext
Dim i As Integer = 0
Do While (i < tfCounter)
    'get first field
    Dim currField As TXTextControl.TextField = CType(tfEnum.Current,TXTextControl.TextField)
    'set enum to the next field
    tfEnum.MoveNext
    Console.WriteLine(("start: " + currField.Start))
    'remove the current field
    textControl1.TextFields.Remove(currField)
    i = (i + 1)
Loop