[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Collapse]Diagram Control
    Getting Started
   [Collapse]Diagram Control
     Diagram Designer Control
     Canvas
     Shapes Panel
     Properties Panel
     Ribbon
     Bottom Panel
     Page Setup Dialog Window
     Print Preview
     Pan and Zoom Panel
     DefaultBarItemNames
   [Expand]End-User Interaction
   [Expand]Diagram Items
   [Expand]Automatic Layout
   [Expand]Data Binding
    Themes and Styles
    Printing and Exporting
    Saving and Loading Diagrams
   [Expand]Examples
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Canvas

Expanded Overview

The Canvas is a working area where end-users build diagrams using shapes and connectors. Its features include:

  • Grid and rulers

    The grid and rulers help end-users arrange shapes on the canvas. Their visibility can be toggled on the View page of the Ribbon. The grid is dynamically changed during zooming. When the end-user zoom in or out of the drawing, the grid spacing is adjusted automatically to be more appropriate for the new magnification.

  • Page breaks

    The Canvas is composed of drawing pages. The number of drawing pages can be adjusted depending on the diagram size. To learn more about pages, see Page Setup.

The following image demonstrates a simple block diagram that occupies 2 drawing pages. The Canvas displays grid lines, rulers, and line breaks.

The table below lists the main properties that affect the canvas behavior and appearance.

Characteristics

Members

Grid line visibility

DiagramControl.ShowGrid

Ruler visibility

DiagramControl.ShowRulers

Page break visibility

DiagramControl.ShowPageBreaks

Size

DiagramControl.PageSize, DiagramControl.CanvasSizeMode

Background

DiagramControl.BackgroundTemplate

Page background

DiagramControl.DiagramPageBackgroundTemplate

DiagramControl.DiagramPageBackgroundTemplateSelector

Scrollling mode

DiagramControl.ScrollMode

Snapping shapes into position

DiagramControl.SnapToGrid, DiagramControl.SnapToItems

To scroll the diagram contents in code, use the DiagramControl.ScrollToPoint method. Alternatively, use the DiagramControl.FitToItems method to scroll the diagram and change its zoom factor so that the viewport is sufficiently large to display the specified items.

Expanded Basic Actions

To scroll the diagram contents

Select the pan tool in the Tools group of the Ribbon and drag on the canvas or use the scrollbars.

To add a shape to the canvas

Drag the shape from the Shapes Panel or select a drawing tool (Rectangle, Ellipse, Right Triangle, Hexagon) in the Tools group of the Ribbon and drag on the canvas to draw the corresponding shape.

To select a shape on the canvas

Choose the Pointer tool on the Tools Ribbon group and click a shape you want to select.

To select multiple shapes on the canvas

Hold down the CTRL key and click each item you want to select.

Alternatively, draw a selection rectangle around the shapes you want to select. The selection rectangle appears when you drag the mouse pointer.

To resize a shape

Select the shape and drag a selection handle or change the Size property in the Properties Panel.

To move a shape

Select the shape and use the arrow keys on your keyboard or drag with the mouse. You can also change the Position property in the Properties panel.

To rotate a shape

Select the shape and drag the rotation handle with the mouse or change the Angle property in the Properties panel.

To add a connector

Select the Connector tool in the Tools group of the Ribbon and drag on the canvas.

To initiate text editing

Double-click a shape or right-click it and select the Edit text menu item. You can also change the Text property within the Properties panel. The text can be formatted using the Ribbon.

To undo or redo an action

Click the corresponding button at the top of the Ribbon or press the CTRL+Z / CTRL+Y key combination.

To change the current zoom

Hold the CTRL button and rotate the mouse wheel or use the zoom trackbar in the Bottom panel.

Expanded See Also

Is this topic helpful?​​​​​​​