Back to Devexpress

SectionColumns.CreateUniformColumns(SectionPage, Single, Int32) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-sectioncolumns-dot-createuniformcolumns-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-sectionpage-system-dot-single-system-dot-int32-x29.md

latest7.1 KB
Original Source

SectionColumns.CreateUniformColumns(SectionPage, Single, Int32) Method

Creates a uniform column layout using the current page settings.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
SectionColumnCollection CreateUniformColumns(
    SectionPage page,
    float columnSpacing,
    int columnCount
)
vb
Function CreateUniformColumns(
    page As SectionPage,
    columnSpacing As Single,
    columnCount As Integer
) As SectionColumnCollection

Parameters

NameTypeDescription
pageSectionPage

A SectionPage object representing a current page.

| | columnSpacing | Single |

A Single value specifying the spacing between adjacent columns, measured in Document.Unit.

| | columnCount | Int32 |

An Int32 value specifying the number of columns on a page. Must be greater than zero.

|

Returns

TypeDescription
SectionColumnCollection

A SectionColumnCollection object representing a collection of columns.

|

Remarks

Use the CreateUniformColumns method to create a layout with the specified number of columns on a page. To apply the layout to a section, use the SectionColumns.SetColumns method, as illustrated below:

csharp
using DevExpress.XtraRichEdit.API.Native;
// ...
richEditControl1.Document.Unit = DocumentUnit.Inch;

Section sectionDoc = richEditControl1.Document.Sections[0];
SectionColumnCollection sectionColumnsLayout = sectionDoc.Columns.CreateUniformColumns(sectionDoc.Page, 0.25f, 3);
sectionDoc.Columns.SetColumns(sectionColumnsLayout);
vb
Imports DevExpress.XtraRichEdit.API.Native
' ...
richEditControl1.Document.Unit = DocumentUnit.Inch

Private sectionDoc As Section = richEditControl1.Document.Sections(0)
Private sectionColumnsLayout As SectionColumnCollection = sectionDoc.Columns.CreateUniformColumns(sectionDoc.Page, 0.25f, 3)
sectionDoc.Columns.SetColumns(sectionColumnsLayout)

The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateUniformColumns(SectionPage, Single, Int32) method.

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/PageLayout.cs#L29

csharp
SectionColumnCollection sectionColumnsLayout =
    firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);
// Set different column width.

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.cs#L34

csharp
SectionColumnCollection sectionColumnsLayout =
    firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);
firstSection.Columns.SetColumns(sectionColumnsLayout);

word-document-api-examples/CS/CodeExamples/PageLayoutActions.cs#L55

csharp
SectionColumnCollection sectionColumnsLayout =
    firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/PageLayout.vb#L26

vb
' Create equal width column layout.
Dim sectionColumnsLayout As DevExpress.XtraRichEdit.API.Native.SectionColumnCollection = firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2F, 3)
' Set different column width.

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.vb#L24

vb
' Create columns and apply them to the document
Dim sectionColumnsLayout As SectionColumnCollection = firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2F, 3)
firstSection.Columns.SetColumns(sectionColumnsLayout)

word-document-api-examples/VB/CodeExamples/PageLayoutActions.vb#L50

vb
' Create a uniform column layout.
Dim sectionColumnsLayout As DevExpress.XtraRichEdit.API.Native.SectionColumnCollection = firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2F, 3)
' Apply the column layout to the section.

See Also

SetColumns(SectionColumnCollection)

Document.Unit

RichEditControl.Unit

SectionColumns Interface

SectionColumns Members

DevExpress.XtraRichEdit.API.Native Namespace