A
A
AlexRayn2020-05-22 19:51:57
C++ / C#
AlexRayn, 2020-05-22 19:51:57

winforms. How to loop through a PictureBox array?

I have 10 PictureBoxes, how do I loop through them? Through for it is impossible to refer to the i-th element, through foreach I don’t understand how.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-05-22
@AlexRayn

var boxes = new List<PictureBox>();
boxes.AddRange(new PictureBox[]  { 
pctBox1,
pctBox2,
pctBox3,
pctBox4,
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question