我做控件时出现的错误
模块是UserControl
函数是
Public Property Set ActiveControl(ByVal New_ActiveControl As Control)
Set m_ActiveControl = New_ActiveControl
PropertyChanged "ActiveControl"
End Property
编译时出错:
Private object modules cannot be used in public object modules as parameters or return types for public procedures, as public data members, or as fields of public user defined types
模块是UserControl
函数是
Public Property Set ActiveControl(ByVal New_ActiveControl As Control)
Set m_ActiveControl = New_ActiveControl
PropertyChanged "ActiveControl"
End Property
编译时出错:
Private object modules cannot be used in public object modules as parameters or return types for public procedures, as public data members, or as fields of public user defined types
New_ActiveControl As Control不行啦,用诸如boolean,long,int,string等类型
如果在运行时还可以,但是不能用PropertyChanged来更新属性
如果你写exe的话没问题,可自己做控件的话不能用这些私有对象做接口。
想象一下,如果你用VB某个类型的控件作为ocx函数接口,别人用另一种语言来调用你做的控件,根本就不支持这种类型的控件该怎么办?