MESCIUS SPREAD for Windows Forms 15.0J
ShapeActivated イベント
使用例 

ユーザーがアクティブシェイプオブジェクトを変更したときに発生します。
構文
'宣言
 
Public Event ShapeActivated As EventHandler
public event EventHandler ShapeActivated
解説
このイベントは、ユーザーがアクティブシェイプオブジェクトを変更したときにOnShapeActivatedメソッドによって生成されます。
使用例
次のサンプルコードは、シェイプがアクティブになったときにテキストボックスにテキストを設定します。
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";
}
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
参照

FpSpread クラス
FpSpread メンバ

 

 


© MESCIUS inc. All rights reserved.