Friday, July 04, 2008  



 FarPoint Technologies
 (800) 645-5913

 fpsales@fpoint.com



     
 »Spread for Windows Forms » Product Tour » Shapes » Working With

Previous Working With Shapes Next

  Back to Top
 Working with Shapes in Code
Besides working with shapes using the toolbar, you can also add and remove shapes programmatically.
  • You can add a shape in code using the AddShape method
  • You can remove a shape using the RemoveShape method
  • You can remove all the shapes using the ClearShapes method
  • You can get a shape using the GetShape method
// Add arrow shape with its outline color and background color being set.
FarPoint.Win.Spread.DrawingSpace.ArrowShape arrow = new FarPoint.Win.Spread.DrawingSpace.ArrowShape();
arrow.BackColor = Color.Plum;
arrow.ForeColor = Color.Pink;
arrow.SetBounds(0,0,200,100);
fpSpread1.ActiveSheet.AddShape(arrow);

' Add arrow shape with its outline color and background color being set.
dim arrow as new FarPoint.Win.Spread.DrawingSpace.ArrowShape()
arrow.BackColor = Color.Plum
arrow.ForeColor = Color.Pink
arrow.SetBounds(0,0,200,100)
fpSpread1.ActiveSheet.AddShape(arrow)


 Designing a Shape from the Toolbar
The easiest way to design shapes on top of the spreadsheet is to use the Drawing toolbar. This toolbar consists of a Draw menu, a link to the Shape Properties dialog, and several drawing-related icons for selecting the shape, the color, and line thickness. The drawing toolbar provides a quick way to draw shapes on the spreadsheet using the drawing space.
Play Video play video
AutoShape This brings up a menu to allow you to select from a list of built-in (automatic) shapes.
Order This brings up a menu to allow you to customize the order of shapes which can be on top of each other. Move shapes to the front or back of other shapes.
Nudge This brings up a menu for nudging a shape.
Rotate This brings up a menu to allow you to select typical amounts of rotation for a shape.
Flip This brings up a menu to allow you to flip a shape either horizontally or vertically.
Scale This brings up a menu to allow you to resize a shape proportionally by selecting a scaling factor.
Image This brings up a dialog that lets you select an image and the image properties.
Delete This brings up a menu for deleting a shape or shapes.
   
BackColor This is the color of the background of the shape.
AlphaBlend Value This is the alphablend or amount of blending of the background color with whatever color is behind it.
Outline Color This is the color of the outline of the shape.
ForeColor This is the foreground, or text, color of the shape.
Allow Rotation This determines whether the end user can rotate the shape using the rotate handle. If unchecked, the rotate handle does not appear when the shape is selected.
Locked This determines whether the shape can be moved or resized or rotated. If unchecked, the end user can not do anything to this shape.
Select Font This is the font of the text in the shape.
Enter Text This is the text that appears inside the shape.
Image This is the image that appears in the shape. Notice that the image has its own transparency and background color separate from the shape transparency and color.


 Changing the Appearance of a Shape
You can change several properties of a shape using the Drawing toolbar or through code. These include:
  • Changing the appearance of a shape
  • Adding a Drop Shadow
  • Rotating a Shape
  • Resizing a Shape
  • Moving a Shape


Previous Working With Shapes Next

    
 Have a question?
Have a Question? Ask Us!
Subscribe to the RSS feed!RSS Subscribe
 

 
SD Times 'TOP 100' Industry Innovator - Read the press release (pdf)

Tour Home
Overview
Appearance
User Interaction
Cell Types
Formulas
Managing Data
Data Binding
Import/Export
Printing
Keyboard Interaction
Shapes
Models
Spread Designer
 
Map

Copyright © 1991-2007 FarPoint Technologies, Inc. All rights reserved. All names are property of their respective owners.