Hi ShatterStar,
>>"now once I add the user control I cannot access any elements like buttons, datagrid data sources etc"
After we add elements to UserControl, in UserControl.Designer.cs file we could find the elements defined in UserControl as private members. For example,
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
Private members could not be access from other class. So we can't access user control elements from form. If you want to do it, you could create a public property which return the elements you want to access from outside in your user control.
public Button ButtonWhichCouldAccessFromOutside
{
get
{
return this.button1;
}
}
Best Regards,
Li Wang
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.