Removes all document targets from a Text Control document.

Introduced: 13.0.

Clear()

public void Clear();
Public Sub Clear()

Examples

The following example shows how to use the TXTextControl.DocumentTargetCollection.Clear Method

textControl1.DocumentTargets.Clear();
textBox1.Text = "The textControl1.DocumentTargets has been cleared, the content of the collection is: " + Environment.NewLine + Environment.NewLine);
if ( textControl1.DocumentTargets.Count != 0 ) 
{
        foreach (TXTextControl.DocumentTarget documentTarget in textControl1.DocumentTargets)
            {
                textBox1.AppendText("TargetName:  " + documentTarget.TargetName + Environment.NewLine +
                                     "Name:  " + documentTarget.Name + Environment.NewLine +
                                     "ID: " + documentTarget.ID.ToString() + Environment.NewLine + Environment.NewLine";    
            }
 }
else
    textBox1.Text = "<<< DocumentTargets Collection Test >>>" + Environment.NewLine +
                                "The DocumentTargets Collection Count Property in textControl1 is: " + textControl1.DocumentTargets.Count.ToString()";
textControl1.DocumentTargets.Clear()
textBox1.Text = "The textControl1.DocumentTargets has been cleared, the content of the collection is: " & Environment.NewLine + Environment.NewLine

If textControl1.DocumentTargets.Count <> 0 Then

    For Each documentTarget As TXTextControl.DocumentTarget In textControl1.DocumentTargets
        textBox1.AppendText("TargetName:  " & documentTarget.TargetName + Environment.NewLine & "Name:  " + documentTarget.Name + Environment.NewLine & "ID: " + documentTarget.ID.ToString() + Environment.NewLine + Environment.NewLine, ";    ")
    Next
Else
    textBox1.Text = "<<< DocumentTargets Collection Test >>>" & Environment.NewLine & "The DocumentTargets Collection Count Property in textControl1 is: " + textControl1.DocumentTargets.Count.ToString()
    End If