© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
3 replies
AideedSS

❔ ✅ How to get ImageLocation from Controls?

lets say
PictureBox pb = new PictureBox();
pb.ImageLocation = "....";

panel1.Controls.Add(pb);
PictureBox pb = new PictureBox();
pb.ImageLocation = "....";

panel1.Controls.Add(pb);


and then, I want to retrieve
ImageLocation
ImageLocation
..But with panel1.Controls..
soo
var imageLocate = panel1.Controls[0].ImageLocation;
var imageLocate = panel1.Controls[0].ImageLocation;


ImageLocation
ImageLocation
definition arent available..How to make code able to identify that
panel1.Controls[0]
panel1.Controls[0]
is a
PictureBox
PictureBox
, so I could retrieve
ImageLocation
ImageLocation
?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to test user controls
C#CC# / help
2y ago
❔ How To Refresh ContentPage Controls
C#CC# / help
3y ago
✅ How to get Options from DI
C#CC# / help
2y ago
access form1 controls from a usercontrol
C#CC# / help
2y ago