XRShape.Stretch Property

Gets or sets a value indicating whether or not to stretch a shape to fill its client area when it's rotated.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.1.dll

Declaration

[SRCategory(ReportStringId.CatBehavior)]
[Favorite(true)]
public bool Stretch { get; set; }
<SRCategory(ReportStringId.CatBehavior)>
<Favorite(True)>
Public Property Stretch As Boolean

Property Value

Type Description
Boolean

true to stretch the shape; otherwise, false.

Use the Stretch property to determine whether a shape's image should be stretched to fit the entire size of a control. Otherwise, its proportions should be preserved.

Note

Note that the Stretch property is in effect only if the shape is rotated (its XRShape.Angle property value is different from 0).

Examples

This example demonstrates how to create an XRShape Arrow type control, and set its basic properties.

using System;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraReports.UI;
using DevExpress.XtraPrinting.Shape;
//...

private void button1_Click(object sender, EventArgs e) {
    XtraReport1 report = new XtraReport1();

    // Create a shape control.
    XRShape shape = new XRShape();

    // Set the shape's type to Arrow.
    shape.Shape = new ShapeArrow();

    // Adjust the Arrow shape's main properties.
    shape.Angle = 90;
    shape.Width = 200;
    shape.Height = 200;
    shape.ForeColor = Color.Brown;
    shape.FillColor = Color.Beige;
    shape.Stretch = false;

    // Adjust the Arrow shape's specific properties.
    ((ShapeArrow)shape.Shape).ArrowHeight = 50;
    ((ShapeArrow)shape.Shape).ArrowWidth = 50;
    ((ShapeArrow)shape.Shape).Fillet = 20;

    // Preview the report.
    report.Detail.Controls.Add(shape);
    ReportPrintTool pt = new ReportPrintTool(report);
    pt.ShowPreviewDialog();
}

See Also