Version

Customizing Shapes (Infragistics Excel Engine)

Topic Overview

Purpose

This topic shows you how to use the WorksheetShape properties to change the shape’s look and feel.

Required background

You need to first read the following topics:

Control Configuration Overview

The table below lists the configurable behaviors of the control.

Configurable behavior Configuration details Configuration properties

Set a shape a Fill, Outline and Text.

Customize a shape

Overview

The table below maps the desired behaviors to property settings. The properties are accessed through WorksheetShape and WorksheetShapeWithText classes.

In order to…​ Use this property And set it to…​

Set fill color

Set outline color

Set shape’s visibility

False

Flip the shape

True

Set text inside a shape

Code Example: Customize Excel Shape

The code below demonstrates how to change the fill, outline and/or text of a previously initialized shape.

Property Setting

Fill

SteelBlue

Outline

RoyalBlue

Text

"Inside text of a shape"

In Visual Basic:

shape.Fill = ShapeFill.FromColor(System.Windows.Media.Colors.SteelBlue)
shape.Outline = ShapeOutline.FromColor(System.Windows.Media.Colors.RoyalBlue)
shape.Text = New Infragistics.Documents.Excel.FormattedText("Inside text of a shape")

In C#:

shape.Fill = ShapeFill.FromColor(System.Windows.Media.Colors.SteelBlue);
shape.Outline = ShapeOutline.FromColor(System.Windows.Media.Colors.RoyalBlue);
shape.Text = new Infragistics.Documents.Excel.FormattedText("Inside text of a shape");