I have a very basic application that has buttons in a toolstrip. When a button is clicked it adds the appropriate User Control to my List<Control>
. I then loop through that list creating either TabPages or mdi forms, with the user controls as children. I created an interface for these user controls so that I can ensure that they contain specific variables... specifically, one for the text of its parent TabPage or mdi form.
When I pass my user controls to functions (with a Control signature), I cannot reference variables defined in the interface. I'm wondering what the best way to go about this is. Should I create a new class that inherits "Control" and implements my interface, then change my user controls to be an instance of this new type?
I'm using C#