DocumentLink Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WPF. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WPF. SDK TXTextControl.from the setup.dll
- Inherits
- Text
Field - Document
Link
- Text
Description
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 : TextFieldPublic Class DocumentLink
Inherits TextFieldExamples
The following example 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)The following example creates an internal link to the customer-details destination.
DocumentTarget target = new("CustomerDetails");
textControl.DocumentTargets.Add(target);
DocumentLink documentLink = new("View customer details", target);
textControl.DocumentLinks.Add(documentLink);Dim target As New DocumentTarget("CustomerDetails")
textControl.DocumentTargets.Add(target)
Dim documentLink As New DocumentLink("View customer details", target)
textControl.DocumentLinks.Add(documentLink)Members
Constructors
| Constructor | Description |
|---|---|
| DocumentLink | Initializes a new instance of the DocumentLink class. |
| TextField | Creates a new instance of the TextField class. (Inherited from TextField.) |
Properties
| Property | Description |
|---|---|
| AutoGenerationType | Gets the type of auto-generation. A document link in a table of contents is automatically generated when the table of contents is inserted into the document. |
| Bounds | Gets the bounding rectangle of a text field. The bounding rectangle is the smallest rectangle which contains all characters of the field's text. The rectangle is given in twips with an origin at the upper left corner of the document. (Inherited from TextField.) |
| ContainsInputPosition | Returns true, if the Textfield contains the current text input position. (Inherited from TextField.) |
| Deleteable | Specifies whether a text field can be deleted by the end-user while a TX Text Control document is being edited. The default setting of this property is true. (Inherited from TextField.) |
| DescriptiveText | Gets or sets a descriptive text for a document link. An empty string indicates that the document link has no such text. An empty string can also be used to delete a previously set text. |
| DocumentTarget | Gets or sets an object of the type DocumentTarget specifying to where the link points. If such an object does not exist, the property returns null. |
| DoubleClickEvent | Specifies whether a TextControl.TextFieldDoubleClicked event is raised, if the end-user doubleclicks the text field. If an event is raised, the normal double-click processing, which selects a single word in the text is suppressed. The default setting of this property is true. (Inherited from TextField.) |
| DoubledInputPosition | Specifies whether a text field has a doubled input position in front of its first character and behind its last character. This enables an end-user to decide whether inserted text at these positions will belong to the text field or not. The default setting of this property is false. For all form fields to work properly this property is set to true and cannot be changed to false. (Inherited from TextField.) |
| 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. The default setting of this property is true. (Inherited from TextField.) |
| FormattingBounds | Gets the formatting rectangle of a text field. The formatting rectangle is the largest rectangle to which the area covered by the field can grow. The rectangle is given in twips with an origin at the upper left corner of the document. (Inherited from TextField.) |
| HighlightColor | Gets or sets the highlight color for the text field. The color's alpha value must be less than 255 (opaque) so that the text field's text remains visible. The default value is black with an alpha value of 60 (light gray). (Inherited from TextField.) |
| HighlightMode | Gets or sets a value indicating when the text field is highlighted. (Inherited from TextField.) |
| ID | Gets or sets an identifier for a text field. This identifier can be used to uniquely identify a text field. (Inherited from TextField.) |
| IsSpellCheckingEnabled | Specifies whether a text field's text is checked on misspelled words. The default setting of this property is true. (Inherited from TextField.) |
| Length | Gets the number of characters in a text field. (Inherited from TextField.) |
| Name | Relates a user-defined name to a text field. This can be any kind of text. This name can be used to uniquely identify a text field. (Inherited from TextField.) |
| ShowActivated | Obsolete. Specifies whether a text field toggles its background to gray, if the current input position is in the field. The default setting of this property is false. This property is obsolete and has been superseded by the HighlightColor and HighlightMode properties. (Inherited from TextField.) |
| Start | Gets the first character position (one-based) of a text field. (Inherited from TextField.) |
| Text | Returns or sets the text which is contained within a text field. This property is not supported for the DocumentTarget class. (Inherited from TextField.) |