1
Answer

Drag And Drop lines

khaled hosny

khaled hosny

16y
6.9k
1

Hi

I add a new button (button1) on the a form to draw two lines

I wrote this code

private void button1_Click(object sender, EventArgs e)

{

Graphics g = this.CreateGraphics();

Pen redpen = new Pen(Brushes.Red, 2);

Pen greenpen = new Pen(Brushes.Green, 2);

g.DrawLine(redpen ,new Point(50,50),new Point(100,100));

g.DrawLine(greenpen, new Point(200, 50), new Point(250, 100));

}

Now I want to drag these lines, I want to drag them one by one , and drag the both in the same time

how I can do that

plz hep me

thanks

Answers (1)