Spread Windows Forms 8.0 Product Documentation
Shape Property (CustomShape)
Example 


Gets or sets the shape.
Syntax
'Declaration
 
Public Overrides Property Shape As Object
'Usage
 
Dim instance As CustomShape
Dim value As Object
 
instance.Shape = value
 
value = instance.Shape
public override object Shape {get; set;}

Property Value

Object containing the shape
Example
This example creates a custom shape.
System.Drawing.Point[] pts = {new System.Drawing.Point(50, 0), 
        new System.Drawing.Point(0, 100), 
        new System.Drawing.Point(40, 100), 
        new System.Drawing.Point(5, 200), 
        new System.Drawing.Point(80, 80), 
        new System.Drawing.Point(40, 80), 
        new System.Drawing.Point(80, 0), 
        new System.Drawing.Point(50, 0)};

System.Drawing.Drawing2D.GraphicsPath gpath = new System.Drawing.Drawing2D.GraphicsPath();
gpath.AddPolygon(pts);

FarPoint.Win.Spread.DrawingSpace.CustomShape custom = new FarPoint.Win.Spread.DrawingSpace.CustomShape();
custom.Parent = fpSpread1;
// shape should be set before bounds
custom.Shape = gpath;
custom.SetBounds(10, 10, 30, 60);
custom.BackColor = System.Drawing.Color.Yellow;
custom.Name = "customLightningBolt";
fpSpread1.ActiveSheet.AddShape(custom);
Dim pts As System.Drawing.Point() = {New System.Drawing.Point(50, 0),  _
        New System.Drawing.Point(0, 100),  _
        New System.Drawing.Point(40, 100),  _
        New System.Drawing.Point(5, 200),  _
        New System.Drawing.Point(80, 80),  _
        New System.Drawing.Point(40, 80),  _
        New System.Drawing.Point(80, 0),  _
        New System.Drawing.Point(50, 0)}

Dim gpath As System.Drawing.Drawing2D.GraphicsPath = New System.Drawing.Drawing2D.GraphicsPath()
gpath.AddPolygon(pts)

Dim custom As New FarPoint.Win.Spread.DrawingSpace.CustomShape
custom.Parent = FpSpread1
' shape should be set before bounds
custom.Shape = gpath
custom.SetBounds(10, 10, 30, 60)
custom.BackColor = System.Drawing.Color.Yellow
custom.Name = "customLightningBolt"
FpSpread1.ActiveSheet.AddShape(custom)
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

Reference

CustomShape Class
CustomShape Members

 

 


Copyright © GrapeCity, inc. All rights reserved.