ComponentOne Reports for WinForms Designer Edition: ComponentOne Reports for WinForms > Working with C1PrintDocument > Render Objects > Render Objects Containment, Positioning, and Stacking Rules

Render Objects Containment, Positioning, and Stacking Rules

All visible content of a C1PrintDocument is represented by a tree of render objects (instances of types derived from RenderObject, as described above), with the root of the tree being the Body of the document. So in order to add a render object to the document, it must be either added to the Children collection of the document's Body, or to the Children collection of another object already in the hierarchy. For example, the render text in the following code is added to the document's Body.Children collection:

      Visual Basic

Dim doc As New C1PrintDocument()

Dim rt As New RenderText()

rt.Text = "This is a text."

doc.Body.Children.Add(rt)

      C#

C1PrintDocument doc = new C1PrintDocument();

RenderText rt = new RenderText();

rt.Text = "This is a text.";

doc.Body.Children.Add(rt);

A document's Body.Children collection contains all top-level render objects of the document. Each render object in its turn also has a Children collection, which contains render objects within it, and so on. (This is very similar to the way Windows Forms' controls can be nested inside each other – any control has the collection of contained controls, and so on.)

In addition to the document's body, there are two other places for render objects in a document – the page header and footer, accessible via the PageHeader and PageFooter properties.


Render Areas

Stacking

Specifying Render Objects' Size and Location

Examples of relative positioning of render objects

Render Object Shadows

Object Borders


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.