private void LinkLabelAddNewLinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { JobCardTaskControl performance = new JobCardTaskControl(new JobCardTask { ParentTask = JobCardTask, JobCard = JobCardTask.JobCard }); performance.Deleted += ConditionControlDeleted; //if (flowLayoutPanelMain.Controls.Count > 1) performance.ShowHeaders = false; flowLayoutPanelMain.Controls.Add(performance); performance.Focus(); }
private void LinkLabelAddNewLinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { JobCardTaskControl performance = new JobCardTaskControl(new JobCardTask { JobCard = JobCard }); performance.Deleted += ConditionControlDeleted; List <JobCardTaskControl> fcs = flowLayoutPanelMain.Controls.OfType <JobCardTaskControl>().ToList(); if (fcs.Count > 1) { foreach (JobCardTaskControl fc in fcs) { fc.EnableToDelete = true; } } performance.Dock = DockStyle.Top; flowLayoutPanelMain.Controls.Add(performance); performance.Focus(); }