6
Answers

Retrieve all pictureboxes?

Ask a question
Sam M

Sam M

13y
7.9k
1
Hi guys, new to the forum :)

I have a c# program that consists of only one form, and am looking for a way of retrieving an array or list of all the picture boxes in that form.

I am not really new to c# but have only increased my knowledge so far as to accommodate assignment work requirements, i have not 'learnt' the language per se.

I blundered in and  attempted to use this.componants only to find that, visual studio (which is what i am using) informed me there was no object reference in that statement, by which i assume it means the form, but i'm obviously not sure ;)

Ideally it would be some form of 'foreach' however i would appreciate guidance onto any method :D

Anyone have any ideas how i would go about doing this? Or is it even possible?

Thankyou.

Answers (6)