■ RectangleTool 클래스의 AllowEdit 속성을 사용해 편집을 허용하는 방법을 보여준다.
▶ MainForm.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
using System.Drawing; using System.Windows.Forms; using Steema.TeeChart; using Steema.TeeChart.Drawing; using Steema.TeeChart.Styles; using Steema.TeeChart.Tools; namespace TestProject { /// <summary> /// 메인 폼 /// </summary> public partial class MainForm : Form { //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////////////////////////////////////////////// Public #region 생성자 - MainForm() /// <summary> /// 생성자 /// </summary> public MainForm() { InitializeComponent(); Text = "RectangleTool 클래스 : AllowEdit 속성을 사용해 편집 허용하기"; this.tChart.Panel.Pen = new ChartPen(Color.Black); this.tChart.Legend.Visible = false; Line line = new Line(this.tChart.Chart); line.FillSampleValues(20); RectangleTool rectangleTool1 = new RectangleTool(this.tChart.Chart); rectangleTool1.Position = AnnotationPositions.Custom; rectangleTool1.PositionUnits = PositionUnits.Pixels; rectangleTool1.Left = 100; rectangleTool1.Top = 100; rectangleTool1.AutoSize = true; rectangleTool1.AllowEdit = true; rectangleTool1.Shape.Color = Color.Yellow; rectangleTool1.Text = "사각형 1"; RectangleTool rectangleTool2 = new RectangleTool(this.tChart.Chart); rectangleTool2.Position = AnnotationPositions.Custom; rectangleTool2.PositionUnits = PositionUnits.Pixels; rectangleTool2.Left = 200; rectangleTool2.Top = 200; rectangleTool2.AutoSize = true; rectangleTool2.AllowEdit = true; rectangleTool2.Shape.Color = Color.Orange; rectangleTool2.Text = "사각형 2"; RectangleTool rectangleTool3 = new RectangleTool(this.tChart.Chart); rectangleTool3.Position = AnnotationPositions.Custom; rectangleTool3.PositionUnits = PositionUnits.Pixels; rectangleTool3.Left = 300; rectangleTool3.Top = 300; rectangleTool3.AutoSize = true; rectangleTool3.AllowEdit = true; rectangleTool3.Shape.Color = Color.Red; rectangleTool3.Shape.Font.Color = Color.White; rectangleTool3.Text = "사각형 3"; } #endregion } } |