Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 WindowsFormsApplication4
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- Graphics lærred;
- Pen blyant;
- private void btnTegn_Click(object sender, EventArgs e)
- {
- int x1 = int.Parse(txtX1.Text);
- int y1 = int.Parse(txtY1.Text);
- int x2 = int.Parse(txtX2.Text);
- int y2 = int.Parse(txtY2.Text);
- lærred.DrawLine(blyant, x1, y1, x2, y2);
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- lærred = this.CreateGraphics();
- blyant = new Pen(Color.Blue, 1.0f);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement