officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-layout-dot-layoutelementbase.md
Gets coordinates of a rectangle which encompasses the layout element.
Namespace : DevExpress.XtraRichEdit.API.Layout
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
public Rectangle Bounds { get; }
Public ReadOnly Property Bounds As Rectangle
| Type | Description |
|---|---|
| Rectangle |
A Rectangle structure specifying the coordinates of the layout element measured in twips (pixels for Linux OS).
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the Bounds 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-layout-api/CS/MyLayoutPainter.cs#L18
{
Canvas.DrawRectangle(new RichEditPen(Color.FromArgb(141, 179, 226)), plainTextBox.Bounds);
}
returnedInformation += String.Format("Paragrpah index: {0}\r\n", currentParagraphIndex + 1);
returnedInformation += String.Format("Text block bounds: {0}\r\n", currentTextBlock.Bounds);
public override void DrawLineNumberBox(LineNumberBox lineNumberBox) {
Canvas.DrawString(lineNumberBox.Text, lineNumberFont, new RichEditBrush(NumberingFontColor), lineNumberBox.Bounds, this.richEditControl.LayoutUnit);
}
winforms-richedit-layout-api/VB/MyLayoutPainter.vb#L15
If Form1.customDrawText = True Then
Canvas.DrawRectangle(New RichEditPen(Color.FromArgb(141, 179, 226)), plainTextBox.Bounds)
Else
returnedInformation &= String.Format("Paragrpah index: {0}" & Constants.vbCrLf, currentParagraphIndex + 1)
returnedInformation &= String.Format("Text block bounds: {0}" & Constants.vbCrLf, currentTextBlock.Bounds)
Public Overrides Sub DrawLineNumberBox(ByVal lineNumberBox As LineNumberBox)
Canvas.DrawString(lineNumberBox.Text, lineNumberFont, New RichEditBrush(NumberingFontColor), lineNumberBox.Bounds, richEditControl.LayoutUnit)
End Sub
See Also