Add Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Adds a character to the document.
Syntax
Add(char)
Inserts a character at the current text input position.
public bool Add(char character);Public Function Add(character As Char) As Boolean| Parameter | Description |
|---|---|
| character | Specifies the character to insert. |
Add(char, string)
Inserts a character at the current text input position using the specified font.
public bool Add(char character, string fontName);Public Function Add(character As Char, fontName As String) As Boolean| Parameter | Description |
|---|---|
| character | Specifies the character to insert. |
| fontName | Specifies the name of the font which is used for the specified character. |
Add(char, string, int)
Inserts a character at the specified position using the specified font.
public bool Add(char character, string fontName, int textPosition);Public Function Add(character As Char, fontName As String, textPosition As Integer) As Boolean| Parameter | Description |
|---|---|
| character | Specifies the character to insert. |
| fontName | Specifies the name of the font which is used for the specified character. |
| textPosition | Specifies a text input position. The first input position in a document is 0. |
Add(ControlChars)
Inserts a control character at the current text input position.
public bool Add(ControlChars controlChar);Public Function Add(controlChar As ControlChars) As Boolean| Parameter | Description |
|---|---|
| controlChar | Specifies a control character to insert. It can be one of the ControlChars values. |
Add(ControlChars, int)
Inserts a control character at the specified text input position.
public bool Add(ControlChars controlChar, int textPosition);Public Function Add(controlChar As ControlChars, textPosition As Integer) As Boolean| Parameter | Description |
|---|---|
| controlChar | Specifies a control character to insert. It can be one of the ControlChars values. |
| textPosition | Specifies a text input position. The first input position in a document is 0. |
Examples
The following example works with text chars in the current document by using TextCharCollection.Add.
TextCharCollection textCharCollection = textControl.TextChars;
if (!textCharCollection.Add('A', "Arial"))
{
throw new InvalidOperationException("The item could not be inserted.");
}Dim textCharCollection As TextCharCollection = textControl.TextChars
If Not textCharCollection.Add("A"c, "Arial") Then
Throw New InvalidOperationException("The item could not be inserted.")
End If