我想访问fdtlc.Controls而不是fdtlc.flpFlightList.Controls
public partial class FlightDetailListControl : UserControl
{
public ControlCollection Controls //Error circular control reference has been made
{
get
{
return flpFlightList.Controls; // flpFlightList is a FlowLayoutPanel
}
}
public FlightDetailListControl()
{
InitializeComponent();
}
}
答案 0 :(得分:0)
FlightDetailListControl和FlowLayoutPanel都是Controls,因此它们都已经有一个名为Controls的ControllCollection继承自UserControl。您必须在FlightDetailListControl中为您的属性选择另一个名称。