vb.net: multiple inheritance in an interface

房东的猫 提交于 2019-12-05 01:35:06

Similar to Java, in VB.NET interfaces "extend" other interfaces. That means they "inherit" their functionality. They do not implement it.

Public Interface InterfaceName
    Inherits BaseInterface1, BaseInterface2
End Interface

Try

Public Interface InterfaceName
    Inherits BaseInterface1
    Inherits BaseInterface2
End Interface

A workaround is to have the abstract class (mustinherit) pass on the job of defining each item in the interface it does not want to implement with mustoverride. Try to predefine each one in a general sense if possible and make it overridable.

I would be careful when inheriting interfaces.

While it works, I have found that if you bind a BindingList(Of InterfaceName) to a BindingSource and the BindingSource to a DataGridView, then properties in Interface1 and Interface2 are not visible to the Visual Studio DataGridView designer for allocating as columns to the DataGridView.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!