Spread Windows Forms 7.0 Product Documentation
ShapeActivated Event
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : ShapeActivated Event


Glossary Item Box

Occurs when the user changes the active shape object.

Syntax

Visual Basic (Declaration) 
Public Event ShapeActivated As EventHandler
Visual Basic (Usage)Copy Code
Dim instance As FpSpread
Dim handler As EventHandler
 
AddHandler instance.ShapeActivated, handler
C# 
public event EventHandler ShapeActivated

Remarks

This event is raised by the OnShapeActivated method when the user changes the active shape object.

Example

This example puts text in a textbox when the shape is activated.
C#Copy Code
private void Form1_Load(object sender, System.EventArgs e)
{
     FarPoint.Win.Spread.DrawingSpace.RectangleShape rShape = new FarPoint.Win.Spread.DrawingSpace.RectangleShape();
     // Assign a name, overriding the unique default assigned name. 
     rShape.Name = "myRect1";
     // Assign a location at which to start the display of the shape. 
     rShape.Top = 20;
     rShape.Left = 60;
     // Assign a custom fill color to the shape. 
     rShape.BackColor = Color.Blue;
     // Assign a size to the shape.
     rShape.Width = 100;
     rShape.Height = 100;
     // Add the shape to the sheet so that it appears on that sheet. 
     fpSpread1.ActiveSheet.AddShape(rShape); 
}

private void fpSpread1_ShapeActivated(object sender, System.EventArgs e)
{
     textBox1.Text = "Shape Activated";
}
Visual BasicCopy Code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
     Dim rShape As New FarPoint.Win.Spread.DrawingSpace.RectangleShape
     ' Assign a name, overriding the unique default assigned name. 
     rShape.Name = "myRect1" 
     ' Assign a location at which to start the display of the shape. 
     rShape.Top = 20
     rShape.Left = 60
     ' Assign a custom fill color to the shape. 
     rShape.BackColor = Color.Blue
     ' Assign a size to the shape.
     rShape.Width = 100
     rShape.Height = 100
     ' Add the shape to the sheet so that it appears on that sheet. 
     FpSpread1.ActiveSheet.AddShape(rShape)
End Sub

Private Sub FpSpread1_ShapeActivated(ByVal sender As Object, ByVal e As System.EventArgs) Handles FpSpread1.ShapeActivated
     TextBox1.Text = "Shape Activated"
End Sub

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

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