yeshirow:
"Dim WithEvents car As MyCar"这句也能实现类的引用,我感到很奇怪!因为有“WithEvents”,一般使用Private car as New MyCar或者Private Car as MyCar,Set Car=New MyCar,但不能引发事件产生;而用Dim WithEvents car As MyCar不但完成对类的引用,还能引发类中定义的事件!为什么?
如果这样如何:
1、在窗体模块级声明:
Private WithEvents car As MyCar
Private Car as New MyCar
2、在过程或函数中调用Car的属性、方法和事件
不知道会有什么样的结果?会不会出错?
[此贴子已经被作者于2006-8-28 21:38:07编辑过]