'The shape is not displayed on the form when I start working with threads(Window Forms)

where should I insert Graphics it to make the game work???

I want to develop a multithreaded application that simulates the movement of billiard balls on a gaming table. The behavior of each ball (i.e. calculating new coordinates and redrawing) is programmed as a separate thread. The usual physical laws apply on the game table - balls bounce off the walls and corners of the table so that the angle of incidence is equal to the angle of reflection, the only exception for this problem is the absence of interactions between the balls (i.e., simply put, they do not collide). When starting the simulation process, each ball receives some (random) impulse, under the influence of which it moves by inertia, gradually stopping. When the ball stops, the corresponding flow should end. The application makes sure that there is at least one thread that has not finished its work yet. When all the threads are completed, you need to issue the appropriate message. The program should provide the user with the ability to pause/continue or interrupt the motion simulation process. To do this, I created everything that is above, and then I don't understand where to move a little

 public partial class Form1 : Form
    {
        private List<Circle> circles = new List<Circle>();
        private List<Thread> threads = new List<Thread>();
        private bool pause = false;
        public Form1()
        {
            InitializeComponent();
        }

        public void AddCircle()
        {
            Circle circle = new Circle();
            circles.Add(circle);

        }
 private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Space)
                pause = !pause;
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = CreateGraphics();
            g.Clear(Color.White);
            foreach (Circle circle in circles)
                g.FillEllipse(new SolidBrush(circle.color), circle.X, circle.Y, circle.Weidth, circle.Heidth);
        }

        private void Form1_Click(object sender, EventArgs e)
        {
            Thread thread = new Thread(t =>
            {
            AddCircle();
            Thread.Sleep(30);
            })
            { IsBackground = true };
            threads.Add(thread);
            thread.Start();
        }

        
    }
}

this is my class circle

 public class Circle
    {
        public float x;
        public float y;
        public float heidth;
        public float weidth;
        public float dy;
        public float dx;
        public Color color;
        public List<Color> colors = (new Color[] { Color.Pink, Color.Red, Color.Brown, Color.Black }).ToList();
        

        public float X
        {
            set { x = value; }
            get { return x; }
        }

        public float Y
        {
            set { y = value; }
            get { return y; }
        }

        public float Heidth
        {
            set { heidth = value; }
            get { return heidth; }
        }

        public float Weidth
        {
            set { weidth = value; }
            get { return weidth; }
        }

        public float Dy
        {
            set { dy = value; }
            get { return dy; }
        }

        public float Dx
        {
            set { dx = value; }
            get { return dx; }
        }

        public Color Color
        {
            set { color = value; }
            get { return color; }
        }

        public Circle()
        {
            Random random = new Random();
            x = random.Next(10, 600);
            y = random.Next(10, 500);
            color = colors[random.Next(colors.Count)];
            weidth = 10;
            heidth = 10;
            dx = random.Next(-50, 50);
            dy = random.Next(-50, 50);
            
        }
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source