-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
48 lines (41 loc) · 1.22 KB
/
Form1.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace form1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
protected override void OnPaint(PaintEventArgs e)
{
// Draw Line
Graphics g = e.Graphics;
Pen pn1 = new Pen(Color.Red);
Point pt1 = new Point(200, 50);
Point pt2 = new Point(100, 100);
g.DrawLine(pn1, pt1, pt2);
Graphics g1 = e.Graphics;
Pen pn2 = new Pen(Color.Blue);
Point pt3 = new Point(100, 100);
Point pt5 = new Point(200, 150);
g1.DrawLine(pn2, pt3, pt5);
Graphics g2 = e.Graphics;
Pen pn3 = new Pen(Color.Green);
Point pt4 = new Point(200, 150);
Point pt6 = new Point(100, 200);
g2.DrawLine(pn3, pt4, pt6);
}
}
}