'C# Form accessing anonymous objects

I'm throwing the objects that I created with the usercontrol to the flowlayoutPanel as much as the number of data in my database, I want to reach the texts of the selected object when I press and select it.

public void getProduct(string type)
    {

        flowLayoutPanel1.Controls.Clear();
        ServerControl cs = new ServerControl();
        var result = cs.TakeInfo(type);

        for (int i = 0; i < cs.count; i++)
        {
            var tutucu = new UserControl1();
            tutucu.nametag = result[i].Name;
            tutucu.pricetag = result[i].Price;
            tutucu.pathtag = result[i].Path;
            flowLayoutPanel1.Controls.Add(tutucu);
        }

    }

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source