I need a member of my class to be a Control, and for it to implement an interface we define.
If I declare it like this...
public class MyClass
{
public Control MyMember;
}
... then I don't get the interface methods, but if I declare it like this...
public class MyClass
{
public IMyInterface MyMember;
}
...then I don't get the Control methods. Is there a way to specify that MyMember must be initialised to a type that inherits from both? I can't find one on MSDN. Something like...
public class MyClass
{
public Control : IMyInterface MyMember;
}
... or ...
public class MyClass
{
public Control MyMember : IMyInterface;
}
... except that neither of those work. Can I specify interfaces when I declare a member, and if so, how?