Declaring constructor interfaces [in interfaces]

  • Thread starter Thread starter Ruffin Bailey
  • Start date Start date
R

Ruffin Bailey

I want to declare an interface that forces the presence of a certain
constructor (in this case, "Sub New(ByVal ds As DataSet)"). When I
try, I get a

'Sub New' cannot be declared in an interface.

.... error.

Now I could create an object that implements the interface that
includes the contructor and extend it, sure, but as I understand it,
VB.NET isn't going to let me use multiple inheritence, and I need the
interfaces to be implemented by Controls (Panels and UserControls,
mostly). So creating an object with the constructor really isn't an
option.

Is there a way I can declare/require the existence of a certain
constructor in an "interface-like fashion"?

Thanks,

Ruffin Bailey
 
Back
Top