My current code (snippet below) iterates through user info and adds the same custom control to a form based on how many "Meals" (1-6) the user has selected. It appears that all even # controls (the second, fourth and sixth) are added to the previously
added control, rather than the parent form, when I later try to dispose the controls by iterating through this.controls, only 1, 3 and 5 appear, the others appear as children to 1, 3 & 5.
I've reduced controls size, etc. to make sure they're not overlapping (if that can force inheritence?) but no luck. Anyone have suggestions on what to look at or other guidance?
public void drawMealPanel(Meal m, int x, int y)
Controls.MealDisplay md = new Controls.MealDisplay(m);
md.Name = m.name;
md.Tag = m.id.ToString();
md.Left = x;
md.Top = y;
md.DragDrop += new System.Windows.Forms.DragEventHandler(this.MealView_DragDrop);
md.DragEnter += new System.Windows.Forms.DragEventHandler(this.MealView_DragEnter);
View Complete Post