Pictures won't appear on screen

I have 3 pictures in my image list so why won't they appear in the form at all?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

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 WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

            PictureBox[] picturebox = new PictureBox[8000];
            int y = 10;
            int x = 10;
            for (int index = 0; index < 8000; index++)
            {
                Controls.Add(picturebox[index]);
                
                picturebox[index].Location = new Point(x, y);

                picturebox[index].Size = new Size(10, 10);
                picturebox[index].Image = imageList1.Images[0];

                x = x + 10;

                if (x == 650)
                {
                    y = y + 10;
                    x = 10;

                }
            }                                                         
        }
    }
}
Last edited on
What size are the images is the imagelist ?
Try setting the PictureBox.SizeMode to PictureBoxSizeMode.AutoSize;
the pictures are 10x10

doesn't really matter tho i got what i wanted fixed.
Last edited on
Topic archived. No new replies allowed.