
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.
[C#]
public class DocumentLink : TextField
[Visual Basic]
Public Class DocumentLink
Inherits TextField
| Constructor | Description | |
| DocumentLink | Initializes a new instance of the DocumentLink class. |
| Property | Description | |
| Bounds | Gets the bounding rectangle of a text field. | |
| Deleteable | Specifies whether a text field can be deleted by the end-user while a TX Text Control document is being edited. | |
| DocumentTarget | Gets or sets an object of the type DocumentTarget specifying to where the link points. | |
| DoubleClickEvent | Specifies whether a TextControl.TextFieldDoubleClicked event is raised, if the end-user doubleclicks the text field. | |
| DoubledInputPosition | Specifies whether a text field has a doubled input position in front of its first character and behind its last character. | |
| Editable | Specifies whether the text of a text field can be changed by the end-user while a TX Text Control document is being edited. | |
| FormattingBounds | Gets the formatting rectangle of a text field. | |
| ID | Gets or sets an identifier for a text field. | |
| IsSpellCheckingEnabled | Specifies whether a text field's text is checked on misspelled words. | |
| Length | Gets the number of characters in a text field. | |
| Name | Relates a user-defined name to a text field. | |
| ShowActivated | Specifies whether a text field toggles its background to gray, if the current input position is in the field. | |
| Start | Gets the first character position (one-based) of a text field. | |
| Text | Returns or sets the text which is contained within a text field. |
| Method | Description | |
| ScrollTo | Sets the current input position to the beginning of a text field and scrolls it into the visible part of the document. |
The following example shows how to insert a DocumentTarget and a corresponding DocumentLink into a document.
[C#]
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);
[Visual Basic]
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)