The DocumentLink class represents a link in a Text Control document that points to a target in the same document. For more information see the technical article Text Fields and Hypertext Links.

Syntax

public class DocumentLink : TextField
Public Class DocumentLink
  Inherits TextField

Examples

The following examples shows how to insert a DocumentTarget and a corresponding DocumentLink into a document.

textControl1.ViewMode = TXTextControl.ViewMode.PageView;
textControl1.Text = "Page 1\fPage 2\fPage 3";
textControl1.Select(3, 0);

TXTextControl.DocumentTarget newTarget = new TXTextControl.DocumentTarget("Page1");

textControl1.DocumentTargets.Add(newTarget);
textControl1.InputPosition = new TXTextControl.InputPosition(2, 1, 3);
TXTextControl.DocumentLink newLink = new TXTextControl.DocumentLink("Jump to page 1", newTarget);
textControl1.DocumentLinks.Add(newLink);
textControl1.ViewMode = TXTextControl.ViewMode.PageView
textControl1.Text = "Page 1" + Chr(12) + "Page 2" + Chr(12) + "Page 3"
textControl1.Select(3, 0)

Dim newTarget As TXTextControl.DocumentTarget = New TXTextControl.DocumentTarget("Page1")

textControl1.DocumentTargets.Add(newTarget)
textControl1.InputPosition = New TXTextControl.InputPosition(2, 1, 3)
Dim newLink As TXTextControl.DocumentLink = New TXTextControl.DocumentLink("Jump to page 1", newTarget)
textControl1.DocumentLinks.Add(newLink)

Constructors

Constructor Description
DocumentLink Initializes a new instance of the DocumentLink class.

Properties

Property Description
AutoGenerationType Gets the type of auto-generation.
DocumentTarget Gets or sets an object of the type DocumentTarget specifying to where the link points.