I have a main form with 1 panel, the panel has 10 user controls and every user control has on picture box.
Main form:
private void Form1_Load(object sender, EventArgs e)
{
Picturebox1.Image=....
for(int i=0;i<10;i++)
{
uscontrol a=new uscontrol()
{
usimage=Image.Fromfile....
};
panel1.Controls.Add(a);
}
}
User control:
public Image usimage
{
get { return imagebox.Image; }
set { imagebox.Image = value; }
}
How can I do that when I click on one of the user controls, it passes image of that user control to main form and shows it in Picturebox1, thank you.