using System.Collections.Generic;
using System.ComponentModel;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Lesson_Animation
public partial class Form1 : Form
void DrawCircle(int x, int y)
gr.FillEllipse(fig, xc, yc, rad, rad);
gr.DrawEllipse(p, xc, yc, rad, rad);
private void button1_Click(object sender, EventArgs e)
gr = pictureBox1.CreateGraphics();
fon = new SolidBrush(Color.Black);
fig = new SolidBrush(Color.Purple);
gr.FillRectangle(fon, 0, 0, pictureBox1.Width, pictureBox1.Height);
for (int i = 0; i < 15; i++)
x = rand.Next(pictureBox1.Width);
y = rand.Next(pictureBox1.Height);
private void timer1_Tick(object sender, EventArgs e)
gr.FillRectangle(fon, 0, 0, pictureBox1.Width, pictureBox1.Height);
for (int i = 0; i < 15; i++)
x = rand.Next(pictureBox1.Width);
y = rand.Next(pictureBox1.Height);