Add Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Adds to new formatting style to the current document.
Syntax
public bool Add(InlineStyle inlineStyle);Public Function Add(inlineStyle As InlineStyle) As BooleanParameters
| Parameter | Description |
|---|---|
| inlineStyle | Specifies the style to add. |
Return Value
The return value is true, if the style could be added. Otherwise it is false.
Examples
The following example works with inline styles in the current document by using InlineStyleCollection.Add.
InlineStyleCollection inlineStyleCollection = textControl.InlineStyles;
if (!inlineStyleCollection.Add(new InlineStyle("CustomerName")))
{
throw new InvalidOperationException("The item could not be inserted.");
}Dim inlineStyleCollection As InlineStyleCollection = textControl.InlineStyles
If Not inlineStyleCollection.Add(New InlineStyle("CustomerName")) Then
Throw New InvalidOperationException("The item could not be inserted.")
End If