I have an interface that is implemented in a customcontrol:
public interface IArrow{...}
pulblic class Arrow1:UserControl, IArrow{....}
pulblic class Arrow2:UserControl, IArrow{....}
Then i have my form that shows the arrows doing:
Arrow1 arr1=new Arrow1();
Arrow2 arr2=new Arrow1();
this.Controls.Add(arr1);
this.Controls.Add(arr2);
But I want to be able to do this:
IArrow arr1=new Arrow1();
IArrow arr2=new Arrow1();
this.Controls.Add(arr1);
The problem is that I need to cast to add to controls:
this.Controls.Add((Arrow1)arr1);
So my question is what interface my interface has to implement to be able to add into controls? So my IArrow would be:
public interface IArrow:InterfaceToAddToControls {...}
(this is a summary not the full code as you can imagine)