Kod: Zaznacz cały
private void button4_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < numericUpDown3.Value; i++)
            {
                Panel nowy = new Panel();
                nowy.BackColor = System.Drawing.Color.Black;
                nowy.Location = new System.Drawing.Point(100 + 100 * i, 200);
                nowy.Size = new System.Drawing.Size(5, 5);
                nowy.MouseMove += new MouseEventHandler(nowy_MouseMove);
                nowy.MouseDown += new MouseEventHandler(nowy_MouseDown);
                nowy.MouseUp += new MouseEventHandler(nowy_MouseUp);
                nowy.MouseClick += new MouseEventHandler(nowy_MouseClick);
         
                nowy.Cursor = Cursors.SizeAll;
                panele.Add(nowy);
                panel1.Controls.Add(nowy);
                
            }
            panel1.Invalidate();
        }
Robilem cos takiego:
Kod: Zaznacz cały
private void textBox4_MouseClick(object sender, MouseEventArgs e)
        {
            numericUpDown1.Value = e.X;
            numericUpDown2.Value = e.Y;
        }