line.cs

来自「CSharp的MDI窗口事例」· CS 代码 · 共 26 行

CS
26
字号
using System;
using System.Drawing;

namespace MDICSharp
{
	[Serializable]
	public class Line : MDICSharp.Shape
	{
		public Line(Point st, Point ep)
		{
			StartPoint = st;
			EndPoint = ep;
		} // constructor
		public override void DrawShape(Graphics dc, Pen drawPen, Brush brush)
		{
			Rectangle drawArea;
			Size rectSize = new Size((EndPoint.X - StartPoint.X), (EndPoint.Y - StartPoint.Y));
			drawArea = new Rectangle(StartPoint, rectSize);
			Brush b =  new SolidBrush(Color.Red);
			dc.DrawLine(drawPen, StartPoint, EndPoint);
		
			
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?