I would like to know how to add a property from one of my user controls to the base controls property list. Is this possible?
So what I am doing is this:
private static List<LabelType> ConvertControlCollectionToList(Control customContainer)
{
LabelTypeList.LabelProps.Clear();
foreach (Control c in customContainer.Controls)
{
LabelTypeList.LabelProps.Add(new LabelType());
LabelTypeList.LabelProps.Last().Name = c.Name;
LabelTypeList.LabelProps.Last().Top = c.Top;
LabelTypeList.LabelProps.Last().Left = c.Left;
LabelTypeList.LabelProps.Last().Height = c.Height;
LabelTypeList.LabelProps.Last().Width = c.Width;
LabelTypeList.LabelProps.Last().Font = c.Font;
LabelTypeList.LabelProps.Last().Text = c.Text;
LabelTypeList.LabelProps.Last().DataColumn = c.?????
LabelTypeList.LabelProps.Last().Rotation = c.?????
}
return LabelTypeList.LabelProps;
}
I have two properties at the end of the list which are custom to my usercontrol but I need to add them to the base control class so when I load the collection back into a form my settings for DataColumn and Rotation are accessible. Does that make sense?
Thanks.