728x90
반응형
728x170
▶ MainForm.cs
using System;
using System.Drawing;
using System.Windows.Forms;
using Steema.TeeChart.Drawing;
using Steema.TeeChart.Styles;
using Steema.TeeChart.Tools;
namespace TestProject
{
/// <summary>
/// 메인 폼
/// </summary>
public partial class MainForm : Form
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Field
////////////////////////////////////////////////////////////////////////////////////////// Private
#region Field
/// <summary>
/// 포인트 시리즈
/// </summary>
private Points points;
/// <summary>
/// 사각형 도구
/// </summary>
private RectangleTool rectangleTool;
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainForm()
/// <summary>
/// 생성자
/// </summary>
public MainForm()
{
InitializeComponent();
Text = "RectangleTool 클래스 : 사각형 크기 변경 및 드래그 처리하기";
this.tChart.Panel.Pen = new ChartPen(Color.Black);
this.tChart.Legend.Visible = false;
this.points = new Points(this.tChart.Chart);
this.points.FillSampleValues();
this.rectangleTool = new RectangleTool(this.tChart.Chart);
this.rectangleTool.Width = 100;
this.rectangleTool.Height = 20;
this.rectangleTool.Shape.Color = Color.Orange;
this.rectangleTool.Shape.Font.Color = Color.Black;
this.rectangleTool.TextAlign = StringAlignment.Center;
this.rectangleTool.Text = "사각형";
this.rectangleTool.Resizing += rectangleTool_Resizing;
this.rectangleTool.Resized += rectangleTool_Resized;
this.rectangleTool.Click += rectangleTool_Click;
this.rectangleTool.Dragged += rectangleTool_Dragged;
this.rectangleTool.Dragging += rectangleTool_Dragging;
}
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Private
#region 사각형 도구 크기 변경 전 처리하기 - rectangleTool_Resizing(senderEventArgs e)
/// <summary>
/// 사각형 도구 크기 변경 전 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void rectangleTool_Resizing(object sender, EventArgs e)
{
this.rectangleTool.Text = "크기 변경 전";
}
#endregion
#region 사각형 도구 크기 변경 후 처리하기 - rectangleTool_Resized(sender, e)
/// <summary>
/// 사각형 도구 크기 변경 후 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void rectangleTool_Resized(object sender, EventArgs e)
{
this.rectangleTool.Text = "크기 변경 후";
}
#endregion
#region 사각형 도구 클릭시 처리하기 - rectangleTool_Click(sender, e)
/// <summary>
/// 사각형 도구 클릭시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void rectangleTool_Click(object sender, MouseEventArgs e)
{
this.rectangleTool.AutoSize = false;
this.rectangleTool.Text = "클릭시";
}
#endregion
#region 사각형 도구 드래그 전 처리하기 - rectangleTool_Dragging(sender, e)
/// <summary>
/// 사각형 도구 드래그 전 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void rectangleTool_Dragging(object sender, EventArgs e)
{
this.rectangleTool.Text = "드래그 전";
}
#endregion
#region 사각형 도구 드래그 후 처리하기 - rectangleTool_Dragged(sender, e)
/// <summary>
/// 사각형 도구 드래그 후 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void rectangleTool_Dragged(object sender, EventArgs e)
{
this.rectangleTool.Text = "드래그 후";
}
#endregion
}
}
728x90
반응형
그리드형(광고전용)
'TeeChart > WinForm' 카테고리의 다른 글
[TEECHART/WINFORM] Selector 클래스 : Selected 이벤트 사용하기 (0) | 2022.04.02 |
---|---|
[TEECHART/WINFORM] BannerTool 클래스 : 배너 스크롤링하기 (0) | 2022.04.02 |
[TEECHART/WINFORM] Rotate 클래스 : Pen 속성을 사용해 회전시 윤곽선 표시하기 (0) | 2022.04.02 |
[TEECHART/WINFORM] Rotate 클래스 : Rotating 이벤트 사용하기 (0) | 2022.04.02 |
[TEECHART/WINFORM] Rotate 클래스 : 마우스 드래그시 차트 고도와 회전 변경하기 (0) | 2022.04.02 |
[TEECHART/WINFORM] PieTool 클래스 : 마우스 OVER시 파이 슬라이스 포커스 표시하기 (0) | 2022.04.02 |
[TEECHART/WINFORM] NearestPoint 클래스 : Direction 속성을 사용해 최근접 포인트 구하기 (0) | 2022.03.31 |
[TEECHART/WINFORM] NearestPoint 클래스 : 최근접 포인트 구하기 (0) | 2022.03.31 |
[TEECHART/WINFORM] MarksTip 클래스 : 마커 팁 사용하기 (0) | 2022.03.31 |
[TEECHART/WINFORM] LightToolEditor 클래스 : 조명 도구 속성 편집하기 (0) | 2022.03.31 |
댓글을 달아 주세요