officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-table-62c0bf21.md
Gets or sets the vertical offset relative to the Table.RelativeVerticalPosition.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
float OffsetYRelative { get; set; }
Property OffsetYRelative As Single
| Type | Description |
|---|---|
| Single |
The vertical offset in current measure units.
|
The OffsetYRelative property value is ignored for tables with Table.TextWrappingType property is set to TableTextWrappingType.None.
Set the Table.VerticalAlignment property to None to use the OffsetYRelative property.
The OffsetYRelative determines the the table’s position when the Table.RelativeVerticalPosition property is set to Paragraph. The Table.VerticalAlignment property is ignored.
The code sample below shows how to specify the table’s vertical alignment:
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using DevExpress.Office.Utils;
using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
Document document = wordProcessor.Document;
Table table = document.Tables[0];
table.BeginUpdate();
//Wrap text around the table
table.TextWrappingType = TableTextWrappingType.Around;
//Specify vertical alignment:
table.RelativeVerticalPosition = TableRelativeVerticalPosition.Paragraph;
table.VerticalAlignment = TableVerticalAlignment.None;
table.OffsetYRelative = Units.InchesToDocumentsF(2f);
table.EndUpdate();
}
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.API.Native
Imports DevExpress.Office.Utils
Using wordProcessor As New RichEditDocumentServer()
Dim document As Document = wordProcessor.Document
Dim table As Table = document.Tables(0)
table.BeginUpdate()
'Wrap text around the table
table.TextWrappingType = TableTextWrappingType.Around
'Specify vertical alignment:
table.RelativeVerticalPosition = TableRelativeVerticalPosition.Paragraph
table.VerticalAlignment = TableVerticalAlignment.None
table.OffsetYRelative = Units.InchesToDocumentsF(2F)
table.EndUpdate()
End Using
The following code snippets (auto-collected from DevExpress Examples) contain references to the OffsetYRelative 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.
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Table.cs#L274
table.VerticalAlignment = TableVerticalAlignment.None;
table.OffsetYRelative = DevExpress.Office.Utils.Units.InchesToDocumentsF(2f);
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/TableActions.cs#L277
table.VerticalAlignment = TableVerticalAlignment.None;
table.OffsetYRelative = DevExpress.Office.Utils.Units.InchesToDocumentsF(2f);
winforms-richedit-tables-simple-example/CS/TablesSimpleExample/Form1.cs#L88
table.VerticalAlignment = TableVerticalAlignment.None;
table.OffsetYRelative = Units.InchesToDocumentsF(2f);
word-document-api-examples/CS/CodeExamples/TablesActions.cs#L387
table.VerticalAlignment = TableVerticalAlignment.None;
table.OffsetYRelative = DevExpress.Office.Utils.Units.InchesToDocumentsF(2f);
word-document-api-table-examples/CS/Program.cs#L223
table.VerticalAlignment = TableVerticalAlignment.None;
table.OffsetYRelative = Units.InchesToDocumentsF(2f);
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Table.vb#L246
table.VerticalAlignment = DevExpress.XtraRichEdit.API.Native.TableVerticalAlignment.None
table.OffsetYRelative = DevExpress.Office.Utils.Units.InchesToDocumentsF(2F)
'Specify horizontal alignment:
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/TableActions.vb#L246
table.VerticalAlignment = TableVerticalAlignment.None
table.OffsetYRelative = DevExpress.Office.Utils.Units.InchesToDocumentsF(2F)
winforms-richedit-tables-simple-example/VB/TablesSimpleExample/Form1.vb#L72
table.VerticalAlignment = TableVerticalAlignment.None
table.OffsetYRelative = Units.InchesToDocumentsF(2F)
' Specify horizontal alignment:
word-document-api-examples/VB/CodeExamples/TablesActions.vb#L328
table.VerticalAlignment = DevExpress.XtraRichEdit.API.Native.TableVerticalAlignment.None
table.OffsetYRelative = DevExpress.Office.Utils.Units.InchesToDocumentsF(2.0F)
' Specify horizontal alignment.
word-document-api-table-examples/VB/Program.vb#L180
table.VerticalAlignment = TableVerticalAlignment.None
table.OffsetYRelative = Units.InchesToDocumentsF(2F)
'Specify horizontal alignment:
See Also