private void Form1_Load(object sender, System.EventArgs e)
{
//TwoWayArrowシェイプを追加します
FarPoint.Win.Spread.DrawingSpace.TwoWayArrowShape taw = new FarPoint.Win.Spread.DrawingSpace.TwoWayArrowShape();
taw.Name = "TwoWayArrow-01";
taw.BackColor = Color.LightGreen;
taw.SetBounds(10, 30, 240, 120);
fpSpread1.ActiveSheet.AddShape(taw);
}
private void fpSpread1_ShapeActivated(object sender, System.EventArgs e)
{
Console.WriteLine("シェイプが選択されました");
Console.WriteLine("選択されたシェイプ名は:" + fpSpread1.ActiveWindowlessObject.Name + "です");
//選択されたシェイプオブジェクトを取得します
FarPoint.Win.Spread.DrawingSpace.PSShape ps;
ps = fpSpread1.ActiveSheet.GetShape(fpSpread1.ActiveWindowlessObject.Name);
Console.WriteLine("選択されたシェイプの背景色は" + ps.BackColor.ToString() + "です");
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TwoWayArrowシェイプを追加します
Dim taw As New FarPoint.Win.Spread.DrawingSpace.TwoWayArrowShape
taw.Name = "TwoWayArrow-01"
taw.BackColor = Color.LightGreen
taw.SetBounds(10, 30, 240, 120)
FpSpread1.ActiveSheet.AddShape(taw)
End Sub
Private Sub FpSpread1_ShapeActivated(ByVal sender As Object, ByVal e As System.EventArgs) Handles FpSpread1.ShapeActivated
Console.WriteLine("シェイプが選択されました")
Console.WriteLine("選択されたシェイプ名は:" + FpSpread1.ActiveWindowlessObject.Name + "です")
'選択されたシェイプオブジェクトを取得します
Dim ps As FarPoint.Win.Spread.DrawingSpace.PSShape
ps = FpSpread1.ActiveSheet.GetShape(FpSpread1.ActiveWindowlessObject.Name)
Console.WriteLine("選択されたシェイプの背景色は" + ps.BackColor.ToString + "です")
End Sub