问题描述
我有2个类库项目和1个Windows应用程序,如下所示:
ClassLibrary1
公共MustInherit类Class1
Public Function A()as boolean
ClassLibrary2
;公共类Class2 Inherits ClassLibrary1.Class1
Public Function B()as boolean
Windows Application
Form1_Load
Dim obj as ClassLibrary2.Class2
obj.B - 可以访问
obj.A - 这是不可访问的
如果Class1和Class2在同一个ClassLibrary项目中(即ClassLibrary2)那么obj.A可以访问。
任何人都可以告诉我为什么会这样吗?我不知道我在这里遗失了什么。
问候,
Prabi
我可以更好。
Hi,
I have 2 class library projects and 1 windows application as follows:
ClassLibrary1
Public MustInherit class Class1
Public Function A() as boolean
ClassLibrary2
Public class Class2 Inherits ClassLibrary1.Class1
Public Function B() as boolean
Windows Application
Form1_Load
Dim obj as ClassLibrary2.Class2
obj.B -- This is accessible
obj.A -- This is not accessible
If Class1 and Class2 are in same ClassLibrary project (i.e. ClassLibrary2) then obj.A is accessible.
Can anybody tell me why it is so?? I don't know if i am missing something here.
Regards,
Prabi
I can be still better.
这篇关于通过派生类的实例访问基类方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!