Please can u show me the way how to make three line in different directions using c# windows form with three buttons.I made it the code but lines are in same directions.Thnx
Code:
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ThreeLines
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Pen lapsi;
lapsi = new Pen(Color.Red);
Graphics grafika = this.CreateGraphics();
grafika.DrawLine(lapsi, 0, 0, 100, 100);
}
private void button2_Click(object sender, EventArgs e)
{
Pen pen;
pen = new Pen(Color.Black);
Graphics grafika2 = this.CreateGraphics();
grafika2.DrawLine(pen, 200, 200, 300, 300);
}
private void button3_Click(object sender, EventArgs e)
{
Pen pencil;
pencil = new Pen(Color.Blue);
Graphics grafika3 = this.CreateGraphics();
grafika3.DrawLine(pencil, 400, 400, 500, 500);
}
}
}