Spread Windows Forms 6.0 Product Documentation
SizeProportional Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.DrawingSpace Namespace > PSObject Class : SizeProportional Property


Glossary Item Box

Gets or sets whether the user is allowed to resize the object proportionally.

Syntax

Visual Basic (Declaration) 
Public Overridable Property SizeProportional As Boolean
Visual Basic (Usage)Copy Code
Dim instance As PSObject
Dim value As Boolean
 
instance.SizeProportional = value
 
value = instance.SizeProportional
C# 
public virtual bool SizeProportional {get; set;}

Property Value

Boolean: true if the user is allowed to resize the object proportionally; false otherwise

Example

This example shows the use of the property in customizing a shape to illustrate the use of the property for classes that inherit this property.
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);

Point pt = new Point(150, 60);

FarPoint.Win.Spread.DrawingSpace.PSObject pso = new FarPoint.Win.Spread.DrawingSpace.CustomShape();
pso.BackColor = Color.Black;
pso.AlphaBlendBackColor = 90;
pso.Enabled = true;
pso.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical;
pso.CanRotate = true;
pso.CanSize = FarPoint.Win.Spread.DrawingSpace.Sizing.HeightAndWidth;
pso.Shape = gpath;
pso.SetBounds(250, 250, 120, 120);
pso.Location = pt;
pso.ShapeOutlineColor = Color.Red;
pso.ShapeOutlineStyle = Drawing2D.DashStyle.DashDot;
pso.ShapeOutlineThickness = 2;
pso.Size = new Size(60, 60);
pso.SizeProportional = true;
fpSpread1.ActiveSheet.AddShape(pso);
Visual BasicCopy 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 pt As New Point(150, 60)

Dim pso As New FarPoint.Win.Spread.DrawingSpace.CustomShape
pso.BackColor = Color.Black
pso.AlphaBlendBackColor = 90
pso.Enabled = True
pso.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical
pso.CanRotate = True
pso.CanSize = FarPoint.Win.Spread.DrawingSpace.Sizing.HeightAndWidth
pso.Shape = gpath
pso.SetBounds(40, 40, 60, 60)
pso.Location = pt
pso.ShapeOutlineColor = Color.Red
pso.ShapeOutlineStyle = Drawing2D.DashStyle.DashDot
pso.ShapeOutlineThickness = 2
pso.Size = new Size(60, 60)
pso.sizeProportional = True
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

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.