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 WindowsFormsApp8
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Random r = new Random();
int x1 = 400;
int y1 = 300;
int x2, y2;
for (int i = 0; i < 100; i++)
{
Pen pen = new Pen(Color.FromArgb(r.Next(256), r.Next(256), r.Next(256)), 3);
x2 = x1 + r.Next(-100, 100);
y2 = y1 + r.Next(-100, 100);
e.Graphics.DrawLine(pen, x1, y1, x2, y2);
x1 = x2;
y1 = y2;
}
}
}
}