가능한 중복 :
It is possible to copy all the properties of a certain control? (C# window forms)복제 컨트롤 - C#을 (의 WinForm)
내가 설계 시간으로 만들어 제어와 비슷한 컨트롤을 만들어야합니다. 생성 된 컨트롤은 미리 정의 된 컨트롤과 동일한 속성을 가져야합니다. 즉 컨트롤을 복사하려고합니다. 그 목적을위한 단일 코드 줄이 있습니까? 또는 코드 줄로 각 속성을 설정해야합니까? 내가 지금 잘하고 있는가하는 것은 :
ListContainer_Category3 = new FlowLayoutPanel();
ListContainer_Category3.Location = ListContainer_Category1.Location;
ListContainer_Category3.BackColor = ListContainer_Category1.BackColor;
ListContainer_Category3.Size = ListContainer_Category1.Size;
ListContainer_Category3.AutoScroll = ListContainer_Category1.AutoScroll;