Загрузка данных


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 WindowsFormsApp4
{
    public partial class Form1 : Form
    {
        private Random rand = new Random();
        public Form1()
        {
            InitializeComponent();
            this.ClientSize = new Size(800, 600);
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            for (int i = 0; i < 50; i++)
            {
                int w = rand.Next(20, 150);
                int h = rand.Next(20, 150);
                int x = rand.Next(0, this.ClientSize.Width - w);
                int y = rand.Next(0, this.ClientSize.Height - h);
                Color color = Color.FromArgb(rand.Next(256), rand.Next(256), rand.Next(256));
                using (Brush brush = new SolidBrush(color))
                {
                    g.FillRectangle(brush, x, y, w, h);
                }
            }
     
        }
    }
}