Declaring constructor interfaces [in interfaces]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top