Sets the bounds of the object to the specified position and size.
Syntax
Parameters
- x
- X-coordinate for bounding rectangle's top-left corner
- y
- Y-coordinate for bounding rectangle's top-left corner
- width
- Width of bounding rectangle in pixels
- height
- Height of bounding rectangle in pixels
Example
This example creates a custom PSObject.
C# | Copy Code |
---|
System.Drawing.Point[] pts = {new System.Drawing.Point(25, 0),
new System.Drawing.Point(0, 50),
new System.Drawing.Point(20, 50),
new System.Drawing.Point((int)2.5, 100),
new System.Drawing.Point(40, 40),
new System.Drawing.Point(20, 40),
new System.Drawing.Point(40, 0),
new System.Drawing.Point(25, 0)};
System.Drawing.Drawing2D.GraphicsPath gpath = new System.Drawing.Drawing2D.GraphicsPath();
gpath.AddPolygon(pts);
FarPoint.Win.Spread.DrawingSpace.PSObject pso = new FarPoint.Win.Spread.DrawingSpace.CustomShape();
pso.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical;
pso.CanRotate = true;
pso.Shape = gpath;
pso.SetBounds(250, 250, 120, 120);
fpSpread1.ActiveSheet.AddShape(pso); |
Visual Basic | Copy Code |
---|
Dim pts As System.Drawing.Point() = {New System.Drawing.Point(25, 0), _
New System.Drawing.Point(0, 50), _
New System.Drawing.Point(20, 50), _
New System.Drawing.Point(2.5, 100), _
New System.Drawing.Point(40, 40), _
New System.Drawing.Point(20, 40), _
New System.Drawing.Point(40, 0), _
New System.Drawing.Point(25, 0)}
Dim gpath As System.Drawing.Drawing2D.GraphicsPath = New System.Drawing.Drawing2D.GraphicsPath
gpath.AddPolygon(pts)
Dim pso As New FarPoint.Win.Spread.DrawingSpace.CustomShape
pso.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical
pso.CanRotate = True
pso.Shape = gpath
pso.SetBounds(250, 250, 120, 120)
FpSpread1.ActiveSheet.AddShape(pso) |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also