Spread Windows Forms 11.0 Product Documentation
DeleteShape Field
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SpreadActions Class : DeleteShape Field
Deletes the active shape.
Syntax
'Declaration
 
Public Shared ReadOnly DeleteShape As Object
'Usage
 
Dim value As Object
 
value = SpreadActions.DeleteShape
public static readonly object DeleteShape
Example
This example sets up a map that uses the D key to delete the shape if it has focus.
FarPoint.Win.Spread.DrawingSpace.ArrowShape arrow = new FarPoint.Win.Spread.DrawingSpace.ArrowShape(); 
arrow.Parent = fpSpread1; 
arrow.SetBounds(10, 10, 50, 50); 
fpSpread1.ActiveSheet.AddShape(arrow);

FarPoint.Win.Spread.DrawingSpace.ArrowShape crv = new 
FarPoint.Win.Spread.DrawingSpace.CurvedArrowShape(); 
crv.Parent = fpSpread1; 
crv.SetBounds(10, 10, 50, 50); 
fpSpread1.ActiveSheet.AddShape(crv);

FarPoint.Win.Spread.InputMap im; 
im = fpSpread1.GetInputMapWhenShapeHasFocus(); 
FarPoint.Win.Spread.Keystroke k = new FarPoint.Win.Spread.Keystroke(Keys.D, Keys.None); 
im.Put(k, FarPoint.Win.Spread.SpreadActions.RemoveShape); 
fpSpread1.SetInputMapWhenShapeHasFocus(im); 
Dim arrow As New FarPoint.Win.Spread.DrawingSpace.ArrowShape
arrow.Parent = FpSpread1
arrow.SetBounds(10, 10, 50, 50)
FpSpread1.ActiveSheet.AddShape(arrow)

Dim crv As New FarPoint.Win.Spread.DrawingSpace.CurvedArrowShape
crv.Parent = FpSpread1
crv.SetBounds(70, 10, 50, 50)
FpSpread1.ActiveSheet.AddShape(crv)

Dim im As FarPoint.Win.Spread.InputMap
im = FpSpread1.GetInputMapWhenShapeHasFocus()
Dim k As New FarPoint.Win.Spread.Keystroke(Keys.D, Keys.None)
im.Put(k, FarPoint.Win.Spread.SpreadActions.RemoveShape)
FpSpread1.SetInputMapWhenShapeHasFocus(im)
Remarks

This action, when a shape has focus, deletes that shape.

The default key combination assigned to this action, when the shape has focus, is the Delete key.

You can use this action along with a custom key combination by defining your own input or action map. For more information about maps, see Managing Keyboard Interactions.

See Also

Reference

SpreadActions Class
SpreadActions Members

User-Task Documentation

Using Shapes