Back to Devexpress

RichEditControl.ActiveViewType Property

windowsforms-devexpress-dot-xtrarichedit-dot-richeditcontrol-b65f2417.md

latest7.7 KB
Original Source

RichEditControl.ActiveViewType Property

Gets or sets the type of the RichEditControl’s View.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.XtraRichEdit.v25.2.dll

NuGet Package : DevExpress.Win.RichEdit

Declaration

csharp
[DXCategory("Layout")]
public RichEditViewType ActiveViewType { get; set; }
vb
<DXCategory("Layout")>
Public Property ActiveViewType As RichEditViewType

Property Value

TypeDescription
RichEditViewType

A RichEditViewType enumeration value specifying the active View type.

|

Available values:

NameDescription
Simple

Specifies that the control is in a simple mode used for simple text and web pages. This mode shows how the document looks as a website.

| | Draft |

Specifies that the control is in a draft mode.

| | PrintLayout |

Specifies that the control is in a print layout mode. In this mode, the control displays pages with all formattings applied.

|

Remarks

The ActiveViewType property specifies the current RichEditControl view. Use the RichEditControl.ActiveView property to access the current view and change its options (zoom factor, background color, etc.)

Example

This example demonstrates how to change the RichEditControl View using the RichEditControl.ActiveViewType property.

csharp
// Switch the RichEdit to the Draft mode.
richEditControl.ActiveViewType = RichEditViewType.Draft;

// Switch the RichEdit to the Simple mode.
richEditControl.ActiveViewType = RichEditViewType.Simple;

// Switch the RichEdit to the Print Layout mode.
richEditControl.ActiveViewType = RichEditViewType.PrintLayout;
vb
' Switch the RichEdit to the Draft mode.
richEditControl.ActiveViewType = RichEditViewType.Draft

' Switch the RichEdit to the Simple mode.
richEditControl.ActiveViewType = RichEditViewType.Simple

' Switch the RichEdit to the Print Layout mode.
richEditControl.ActiveViewType = RichEditViewType.PrintLayout

The following code snippets (auto-collected from DevExpress Examples) contain references to the ActiveViewType 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-richeditcontrol-common-api/CS/RichEditAPISample/Form1.cs#L470

csharp
if(newExample.RegionName == "Get Bounds from Document Position") {
    richEditControl.ActiveViewType = RichEditViewType.Simple;
}

winforms-richedit-in-an-active-grid-cell/CS/Form1.cs#L28

csharp
// TODO: Use any RichEditControl API
richEditControl.ActiveViewType = RichEditViewType.PrintLayout;
richEditControl.ActiveView.ZoomFactor = 2f;

winforms-tabbed-ui-control-based-document/CS/DcoumentManagerContentGenerator/Form1.cs#L28

csharp
newTB.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
newTB.ActiveViewType = DevExpress.XtraRichEdit.RichEditViewType.PrintLayout;
newTB.Views.PrintLayoutView.ZoomFactor = 0.7f;

winforms-richedit-implement-t-sql-language-syntax-highlighting/CS/Form1.cs#L16

csharp
richEditControl1.LoadDocument("CarsXtraScheduling.sql");
richEditControl1.ActiveViewType = DevExpress.XtraRichEdit.RichEditViewType.Draft;
richEditControl1.Document.Sections[0].Page.Width = Units.InchesToDocumentsF(80f);

winforms-richedit-adjust-left-document-padding/CS/Form1.cs#L17

csharp
richEditControl1.ActiveViewType = RichEditViewType.Simple;

winforms-richeditcontrol-common-api/VB/RichEditAPISample/Form1.vb#L467

vb
If newExample.RegionName = "Get Bounds from Document Position" Then
    richEditControl.ActiveViewType = RichEditViewType.Simple
Else

winforms-richedit-in-an-active-grid-cell/VB/Form1.vb#L27

vb
' TODO: Use any RichEditControl API
richEditControl.ActiveViewType = RichEditViewType.PrintLayout
richEditControl.ActiveView.ZoomFactor = 2F

winforms-tabbed-ui-control-based-document/VB/DcoumentManagerContentGenerator/Form1.vb#L30

vb
newTB.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder
newTB.ActiveViewType = DevExpress.XtraRichEdit.RichEditViewType.PrintLayout
newTB.Views.PrintLayoutView.ZoomFactor = 0.7f

winforms-richedit-implement-t-sql-language-syntax-highlighting/VB/Form1.vb#L15

vb
richEditControl1.LoadDocument("CarsXtraScheduling.sql")
richEditControl1.ActiveViewType = DevExpress.XtraRichEdit.RichEditViewType.Draft
richEditControl1.Document.Sections(0).Page.Width = Units.InchesToDocumentsF(80F)

winforms-richedit-adjust-left-document-padding/VB/Form1.vb#L17

vb
AdjustDraftViewPadding()
richEditControl1.ActiveViewType = RichEditViewType.Simple
richEditControl1.Text = "Test"

See Also

SwitchToDraftViewCommand

SwitchToSimpleViewCommand

SwitchToPrintLayoutViewCommand

ActiveViewChanged

RichEditControl Class

RichEditControl Members

DevExpress.XtraRichEdit Namespace