Back to Devexpress

CharacterPropertiesBase.Position Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-characterpropertiesbase-74c98b9c.md

latest3.5 KB
Original Source

CharacterPropertiesBase.Position Property

Gets or sets the position of characters (in points) relative to the base line.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
float? Position { get; set; }
vb
Property Position As Single?

Property Value

TypeDescription
Nullable<Single>

A text position (from -3168 to 3168) relative to the base line or null ( Nothing in Visual Basic) for a mixture of values. A positive number raises the text, and a negative number lowers it.

|

Remarks

The code sample below shows how to raise the text by 2 points:

csharp
using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
    wordProcessor.LoadDocument("Document.docx");
    Document document = wordProcessor.Document;
    CharacterProperties characterProperties = document.BeginUpdateCharacters(document.Paragraphs[1].Range);
    characterProperties.Position = 2;
    document.EndUpdateCharacters(characterProperties);
}
vb
Using wordProcessor As New RichEditDocumentServer()
    wordProcessor.LoadDocument("Document.docx")
    Dim document As Document = wordProcessor.Document
    Dim characterProperties As CharacterProperties = document.BeginUpdateCharacters(document.Paragraphs(1).Range)
    characterProperties.Position = 2
    document.EndUpdateCharacters(characterProperties)
  End Using

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Position property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

word-document-api-examples/CS/CodeExamples/FormattingActions.cs#L78

csharp
// Raise the text by 2 points.
cp.Position = 2;

word-document-api-examples/VB/CodeExamples/FormattingActions.vb#L64

vb
' Raise the text by 2 points.
cp.Position = 2
' Finalize to modify character formatting.

See Also

CharacterPropertiesBase Interface

CharacterPropertiesBase Members

DevExpress.XtraRichEdit.API.Native Namespace