نکته شماره 14 :

 

private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
// ایجاد کردن خودکار
Pen blackPen = new Pen(Color.Black, 3);
//ایجاد نقاط که تعریف چند ضلعی.
Point point1 = new Point(30, 50);
Point point2 = new Point(100, 25);
Point point3 = new Point(200, 5);
Point point4 = new Point(250, 50);
Point point5 = new Point(270, 100);
Point point6 = new Point(250, 250);
Point[] curvePoints = {point1, point2, point3, point4, point5, point6};
// رسم چند ضلعی به روی صفحه نمایش.
g.DrawPolygon(blackPen, curvePoints);
//چند ضلعی پر
g.FillPolygon(Brushes.Red, curvePoints);
}