I am adding User Control to my Main Windows Foam, the User Control consist of Tablelayoutpanel which include 2 Combo Boxes,1 Button and 4 Text Boxes, as shown in the picture below:
How can I access each of these controls as I add more Controls in Runtime Such as this in image below
In my practice I know to access controls which are created in Design Time but I don't know how to access Control which are generated in Runtime.
I tried Button Click event, but It shows Click event of Single button only, how can I access Click Event for multiple button added in Runtime.
Update2:
Do you mean remove the control's parent control?
Update:
I misunderstood your runtime creation.
In fact, even multiple usercontrols are created at design time. They all have their own names.
You can add events to them using the same method.
This example shows how to add your own events to multiple buttons contained in a usercontrol.
Create a usercontrol as follows:
Create a winform project as follows:
Using this as an example, you can add individual events to them, or you can add a unified event.
Just find them from the corresponding container.