[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
  [Collapse]Spreadsheet
    Product Structure
   [Expand]Getting Started
   [Expand]Spreadsheet Document
    Supported Formats
   [Expand]Cell Basics
   [Expand]Formulas
    Defined Names
    Data Binding
    Data Validation
   [Expand]Data Presentation
   [Expand]Pivot Table Overview
   [Expand]Charting Overview
    Shapes
    Printing
    Protection
    Find and Replace
   [Expand]Mail Merge
   [Expand]Visual Elements
    Services
    Themes and Templates
   [Expand]Shortcuts
   [Expand]Examples
  [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
  [Expand]Diagram Control
  [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]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Shapes

The WPF Spreadsheet control allows you to view, print, and export documents that contain shapes to PDF/HTML. All shape types are supported: from simple lines and rectangles to banners and callouts.

Expanded Working with Shapes in UI

The SpreadsheetControl enables end-users to move, resize, rotate, or remove shapes in a document.

Note

The SpreadsheetControl does not provide user interface elements that allow end-users to insert new shapes, edit existing shapes, and change their appearance.

Expanded Shape API

An individual shape (Shape) is a member of the Worksheet.Shapes collection. The ShapeCollection collection stores all drawing objects embedded in a worksheet (shapes, pictures, and charts). You can access an existing shape by its index in the shape collection or using the ShapeCollection.GetShapeById method. The Shape.ShapeType property allows you to distinguish between different drawing object types within a worksheet.

The ShapeCollection and Shape interfaces provide methods and properties designed to manipulate shapes in a document.

Property

Description

Example

ShapeCollection.AddShape

Creates a shape.

How to: Create a Shape

ShapeCollection.AddTextBox

Creates a text box.

How to: Add Text to a Shape

Shape.ShapeGeometry

Specifies a shape's geometry.

How to: Create a Shape

ShapeCollection.GroupShapes

Creates a group of shapes.

How to: Create a Shape Group

ShapeCollection.UngroupShapes

Splits a shape group into individual shapes.

How to: Create a Shape Group

ShapeCollection.AddConnector

Creates a connector.

How to: Create a Shape Connector

Shape.ConnectorFormat

Provides access to connector settings.

How to: Create a Shape Connector

Shape.ShapeText

Provides access to a shape's text format settings.

How to: Add Text to a Shape

ShapeText.Characters

Allows you to add text to a shape and specify its font characteristics and paragraph properties.

How to: Add Text to a Shape

ShapeFormatBase.Fill

Provides access to a shape's fill options.

How to: Change Shape's Fill and Outline Color

ShapeFormatBase.Outline

Provides access to options used to format a shape's outline.

How to: Change Shape's Fill and Outline Color

ShapeCollection.RemoveAt,

Shape.Delete

Removes a shape from a worksheet.

How to: Remove a Shape

Expanded See Also

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