Back to Devexpress

SubDocument.SetPageBackground(Color, Boolean) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-subdocument-dot-setpagebackground-x28-system-dot-drawing-dot-color-system-dot-boolean-x29.md

latest7.8 KB
Original Source

SubDocument.SetPageBackground(Color, Boolean) Method

Sets the background color of the page and specifies whether it is shown.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
void SetPageBackground(
    Color pageBackColor,
    bool showPageBackground
)
vb
Sub SetPageBackground(
    pageBackColor As Color,
    showPageBackground As Boolean
)

Parameters

NameTypeDescription
pageBackColorColor

A Color structure specifying the color.

| | showPageBackground | Boolean |

true to show the specified background color; otherwise, false.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the SetPageBackground(Color, Boolean) 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-spreadsheetcontrol-api-part-3/CS/SpreadsheetControl_API_Part03/CodeUtils/ExampleCodeEditor.cs#L129

csharp
{
    CurrentCodeEditor.Document.SetPageBackground((codeEvaluated) ? DXColor.Empty : DXColor.FromArgb(0xFF, 0xBC, 0xC8), true);
    CurrentCodeClassEditor.Document.SetPageBackground((codeEvaluated) ? DXColor.Empty : DXColor.FromArgb(0xFF, 0xBC, 0xC8), true);

winforms-richedit-document-api/CS/RichEditAPISample/CodeUtils/ExampleCodeEditor.cs#L129

csharp
{
    CurrentCodeEditor.Document.SetPageBackground((codeEvaluated) ? DXColor.Empty : DXColor.FromArgb(0xFF, 0xBC, 0xC8), true);
    CurrentCodeClassEditor.Document.SetPageBackground((codeEvaluated) ? DXColor.Empty : DXColor.FromArgb(0xFF, 0xBC, 0xC8), true);

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeUtils/ExampleCodeEditor.cs#L131

csharp
{
    CurrentCodeEditor.Document.SetPageBackground((codeEvaluated) ? DXColor.Empty : DXColor.FromArgb(0xFF, 0xBC, 0xC8), true);
    CurrentCodeClassEditor.Document.SetPageBackground((codeEvaluated) ? DXColor.Empty : DXColor.FromArgb(0xFF, 0xBC, 0xC8), true);

wpf-spreadsheet-chart-api/CS/SpreadsheetWPFChartAPISamples/CodeUtils/SpreadsheetApiModuleUtils.cs#L86

csharp
void UpdatePageBackground(bool codeEvaluated) {
    CurrentCodeEditor.Document.SetPageBackground((codeEvaluated) ? DXColor.Empty : DXColor.FromArgb(0xFF, 0xBC, 0xC8), true);
}

wpf-spreadsheet-pivot-table-api-examples/CS/SpreadsheetWPFPivotTableExamples/CodeUtils/SpreadsheetApiModuleUtils.cs#L102

csharp
{
    CurrentCodeEditor.Document.SetPageBackground((codeEvaluated) ? DXColor.Empty : DXColor.FromArgb(0xFF, 0xBC, 0xC8), true);
}

winforms-spreadsheetcontrol-api-part-3/VB/SpreadsheetControl_API_Part03/CodeUtils/ExampleCodeEditor.vb#L127

vb
Private Sub UpdatePageBackground(ByVal codeEvaluated As Boolean)
    CurrentCodeEditor.Document.SetPageBackground(If(codeEvaluated, DXColor.Empty, DXColor.FromArgb(&HFF, &HBC, &HC8)), True)
    CurrentCodeClassEditor.Document.SetPageBackground(If(codeEvaluated, DXColor.Empty, DXColor.FromArgb(&HFF, &HBC, &HC8)), True)

winforms-richedit-document-api/VB/RichEditAPISample/CodeUtils/ExampleCodeEditor.vb#L127

vb
Private Sub UpdatePageBackground(ByVal codeEvaluated As Boolean)
    CurrentCodeEditor.Document.SetPageBackground(If(codeEvaluated, DXColor.Empty, DXColor.FromArgb(&HFF, &HBC, &HC8)), True)
    CurrentCodeClassEditor.Document.SetPageBackground(If(codeEvaluated, DXColor.Empty, DXColor.FromArgb(&HFF, &HBC, &HC8)), True)

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeUtils/ExampleCodeEditor.vb#L125

vb
Private Sub UpdatePageBackground(ByVal codeEvaluated As Boolean)
    CurrentCodeEditor.Document.SetPageBackground(If(codeEvaluated, DXColor.Empty, DXColor.FromArgb(&HFF, &HBC, &HC8)), True)
    CurrentCodeClassEditor.Document.SetPageBackground(If(codeEvaluated, DXColor.Empty, DXColor.FromArgb(&HFF, &HBC, &HC8)), True)

wpf-spreadsheet-chart-api/VB/SpreadsheetWPFChartAPISamples/CodeUtils/SpreadsheetApiModuleUtils.vb#L97

vb
Private Sub UpdatePageBackground(ByVal codeEvaluated As Boolean)
    CurrentCodeEditor.Document.SetPageBackground(If(codeEvaluated, DXColor.Empty, DXColor.FromArgb(&HFF, &HBC, &HC8)), True)
End Sub

wpf-spreadsheet-pivot-table-api-examples/VB/SpreadsheetWPFPivotTableExamples/CodeUtils/SpreadsheetApiModuleUtils.vb#L96

vb
Private Sub UpdatePageBackground(ByVal codeEvaluated As Boolean)
    CurrentCodeEditor.Document.SetPageBackground(If(codeEvaluated, DXColor.Empty, DXColor.FromArgb(&HFF, &HBC, &HC8)), True)
End Sub

See Also

PageBackColor

ShowPageBackground

EnablePageBackgroundOnPrint

SubDocument Interface

SubDocument Members

DevExpress.XtraRichEdit.API.Native Namespace