要调用窗体变量,可将需要访问的变量通过共有属性/方法等提供
比如上面Form1代码中添加一属性PropTst用来访问其变量m_PropTst as long
Public Property Get PropTst() As Long
PropTst = m_PropTst
End Property
那么在调用方法中就可以使用该属性:
public function 方法()
dim fForm1 as Form1
set fForm1=new Form1
fForm1.Show vbModal
debug.print fForm1.PropTst '显示该属性
end function