作成日: 2022/01/21 最終更新日: 2022/02/24
文書種別
使用方法
詳細
チャートやシェイプを選択した状態での既定のキー操作については、次のページでご案内しております。
既定キー一覧 > シェイプの既定の動作
既定キー一覧 > シェイプの既定の動作
[Delete]キーには、既定でDeleteShapeアクションが割り当てられていますが、以下ではこれを無効に設定します。
◎サンプルコード(VB)
◎サンプルコード(C#)
◎サンプルコード(VB)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' チャートの設定
Dim chart1 As New FarPoint.Win.Spread.Chart.SpreadChart()
chart1.ChartName = "chart1"
chart1.Size = New Size(200, 180)
chart1.Location = New Point(0, 0)
Dim Series = New FarPoint.Win.Chart.BarSeries()
Series.SeriesName = "Series 0"
Series.Values.Add(2.0)
Series.Values.Add(4.0)
Series.Values.Add(3.0)
Series.Values.Add(5.0)
Dim PlotArea = New FarPoint.Win.Chart.YPlotArea()
PlotArea.Location = New PointF(0.2F, 0.2F)
PlotArea.Size = New SizeF(0.6F, 0.6F)
PlotArea.Series.Add(Series)
Dim Model = New FarPoint.Win.Chart.ChartModel()
Model.PlotAreas.Add(PlotArea)
chart1.Model = Model
FpSpread1.ActiveSheet.Charts.Add(chart1)
' シェイプの設定
Dim arrow As New FarPoint.Win.Spread.DrawingSpace.ArrowShape
arrow.Name = "Arrow-01"
arrow.BackColor = Color.Red
arrow.AlphaBlendBackColor = 90
arrow.ShadowColor = Color.Blue
arrow.AlphaBlendShadowColor = 90
arrow.ShadowDirection = FarPoint.Win.Spread.DrawingSpace.ShadowDirection.BottomRight
arrow.SetBounds(10, 10, 90, 60)
FpSpread1.ActiveSheet.AddShape(arrow)
' チャートの設定
Dim chart1 As New FarPoint.Win.Spread.Chart.SpreadChart()
chart1.ChartName = "chart1"
chart1.Size = New Size(200, 180)
chart1.Location = New Point(0, 0)
Dim Series = New FarPoint.Win.Chart.BarSeries()
Series.SeriesName = "Series 0"
Series.Values.Add(2.0)
Series.Values.Add(4.0)
Series.Values.Add(3.0)
Series.Values.Add(5.0)
Dim PlotArea = New FarPoint.Win.Chart.YPlotArea()
PlotArea.Location = New PointF(0.2F, 0.2F)
PlotArea.Size = New SizeF(0.6F, 0.6F)
PlotArea.Series.Add(Series)
Dim Model = New FarPoint.Win.Chart.ChartModel()
Model.PlotAreas.Add(PlotArea)
chart1.Model = Model
FpSpread1.ActiveSheet.Charts.Add(chart1)
' シェイプの設定
Dim arrow As New FarPoint.Win.Spread.DrawingSpace.ArrowShape
arrow.Name = "Arrow-01"
arrow.BackColor = Color.Red
arrow.AlphaBlendBackColor = 90
arrow.ShadowColor = Color.Blue
arrow.AlphaBlendShadowColor = 90
arrow.ShadowDirection = FarPoint.Win.Spread.DrawingSpace.ShadowDirection.BottomRight
arrow.SetBounds(10, 10, 90, 60)
FpSpread1.ActiveSheet.AddShape(arrow)
' シェイプ選択時のDeleteキーのアクションを変更する
Dim im As FarPoint.Win.Spread.InputMap
im = FpSpread1.GetInputMapWhenShapeHasFocus()
Dim del As New FarPoint.Win.Spread.Keystroke(Keys.Delete, Keys.None)
im.Put(del, FarPoint.Win.Spread.SpreadActions.None)
End Sub
Dim im As FarPoint.Win.Spread.InputMap
im = FpSpread1.GetInputMapWhenShapeHasFocus()
Dim del As New FarPoint.Win.Spread.Keystroke(Keys.Delete, Keys.None)
im.Put(del, FarPoint.Win.Spread.SpreadActions.None)
End Sub
◎サンプルコード(C#)
private void Form1_Load(object sender, EventArgs e)
{
// チャートの設定
FarPoint.Win.Spread.Chart.SpreadChart chart1 = new FarPoint.Win.Spread.Chart.SpreadChart();
chart1.ChartName = "chart1";
chart1.Size = new Size(200, 180);
chart1.Location = new Point(0, 0);
FarPoint.Win.Chart.BarSeries Series = new FarPoint.Win.Chart.BarSeries();
Series.SeriesName = "Series 0";
Series.Values.Add(2.0);
Series.Values.Add(4.0);
Series.Values.Add(3.0);
Series.Values.Add(5.0);
FarPoint.Win.Chart.YPlotArea PlotArea = new FarPoint.Win.Chart.YPlotArea();
PlotArea.Location = new PointF(0.2F, 0.2F);
PlotArea.Size = new SizeF(0.6F, 0.6F);
PlotArea.Series.Add(Series);
FarPoint.Win.Chart.ChartModel Model = new FarPoint.Win.Chart.ChartModel();
Model.PlotAreas.Add(PlotArea);
chart1.Model = Model;
fpSpread1.ActiveSheet.Charts.Add(chart1);
// シェイプの設定
FarPoint.Win.Spread.DrawingSpace.ArrowShape arrow = new FarPoint.Win.Spread.DrawingSpace.ArrowShape();
arrow.Name = "Arrow-01";
arrow.BackColor = Color.Red;
arrow.AlphaBlendBackColor = 90;
arrow.ShadowColor = Color.Blue;
arrow.AlphaBlendShadowColor = 90;
arrow.ShadowDirection = FarPoint.Win.Spread.DrawingSpace.ShadowDirection.BottomRight;
arrow.SetBounds(10, 10, 90, 60);
fpSpread1.ActiveSheet.AddShape(arrow);
{
// チャートの設定
FarPoint.Win.Spread.Chart.SpreadChart chart1 = new FarPoint.Win.Spread.Chart.SpreadChart();
chart1.ChartName = "chart1";
chart1.Size = new Size(200, 180);
chart1.Location = new Point(0, 0);
FarPoint.Win.Chart.BarSeries Series = new FarPoint.Win.Chart.BarSeries();
Series.SeriesName = "Series 0";
Series.Values.Add(2.0);
Series.Values.Add(4.0);
Series.Values.Add(3.0);
Series.Values.Add(5.0);
FarPoint.Win.Chart.YPlotArea PlotArea = new FarPoint.Win.Chart.YPlotArea();
PlotArea.Location = new PointF(0.2F, 0.2F);
PlotArea.Size = new SizeF(0.6F, 0.6F);
PlotArea.Series.Add(Series);
FarPoint.Win.Chart.ChartModel Model = new FarPoint.Win.Chart.ChartModel();
Model.PlotAreas.Add(PlotArea);
chart1.Model = Model;
fpSpread1.ActiveSheet.Charts.Add(chart1);
// シェイプの設定
FarPoint.Win.Spread.DrawingSpace.ArrowShape arrow = new FarPoint.Win.Spread.DrawingSpace.ArrowShape();
arrow.Name = "Arrow-01";
arrow.BackColor = Color.Red;
arrow.AlphaBlendBackColor = 90;
arrow.ShadowColor = Color.Blue;
arrow.AlphaBlendShadowColor = 90;
arrow.ShadowDirection = FarPoint.Win.Spread.DrawingSpace.ShadowDirection.BottomRight;
arrow.SetBounds(10, 10, 90, 60);
fpSpread1.ActiveSheet.AddShape(arrow);
// シェイプ選択時のDeleteキーのアクションを変更する
FarPoint.Win.Spread.InputMap im;
im = fpSpread1.GetInputMapWhenShapeHasFocus();
FarPoint.Win.Spread.Keystroke del = new FarPoint.Win.Spread.Keystroke(Keys.Delete, Keys.None);
im.Put(del, FarPoint.Win.Spread.SpreadActions.None);
}
FarPoint.Win.Spread.InputMap im;
im = fpSpread1.GetInputMapWhenShapeHasFocus();
FarPoint.Win.Spread.Keystroke del = new FarPoint.Win.Spread.Keystroke(Keys.Delete, Keys.None);
im.Put(del, FarPoint.Win.Spread.SpreadActions.None);
}