Rysowanie linii



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 RysowanieLinii5
{
    public partial class Form1 : Form
    {
        Graphics g;
      
        public Form1()
        {
            InitializeComponent();
            g = this.CreateGraphics();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void Button1_Click(object sender, EventArgs e)
        {
            Pen p1,p2;
            p1 = new Pen(Color.Blue, 3);
            p2 = new Pen(Color.Red, 5);
            g.DrawLine(p1, 100, 100, 200, 200);
            g.DrawLine(p2, 200, 200, 500, 200);

        }
    }
}