기본 컨트롤 속성 목록에 내 사용자 컨트롤 중 하나의 속성을 추가하는 방법을 알고 싶습니다. 이것이 가능한가?C# 속성 컨트롤 기본 클래스 연결
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;
}
내 UserControl을 사용자 지정되는 목록의 마지막에 두 가지 속성을 가지고 있지만 나는 형태로 다시를 DataColumn 및 회전 내 설정을 컬렉션을로드 할 때 나는 이렇게 기본 컨트롤 클래스에 추가 할 필요가 접근 가능하다. 말이 돼?
감사합니다.
는
답변이 업데이트되었습니다. –