I have two panels on my winform panel: on the first panel I have usercontrolone that can be dynamically multiplied. I want the second panel to display the usercontrolone selected by the user. The idea is that I want to, if I change the text during the execution of mine usercontrol, these changes will be displayed in the second panel. I need an idea how I can do this. I am trying now to create properties for every object of mine usercontroland events, but I think this is too much for this. Thanks.
My code that I have tried so far:
In my usercontrol, I created properties for each object that it contains. Code on usercontrol.cs:
public string TextName
{
get { return textname.Text; }
set { textname.Text = value; }
}
public string Task
{
get { return checkboxTip.Text; }
set { checkboxTip.Text = value; }
}
.......
and on my winform.cs I created an event for all properties:
private void PropertiesChange_Click(object sender, EventArgs e)
{
textname1.Text=textname.Text;
checkboxTip1.Text-checkbox.Text;
.....
source
share