7,785
社区成员




'类模块Class1
public withevents theForm as form
'在类里面处理事件
'窗体中,设已经有一个做好的源窗体frmSource,用于LOAD
'公共区声明
dim myFormArr() as class1
private sub form_load()
redim myformarr(0)
end sub
private sub command1_click()
dim I as long
i=-1
do while i<=100
i=i+1
redim preserve myformarr(i)
set myformarr(i).theform=new frmSource '加载并赋值
loop
end sub
private sub command2_click()
'全部显示或隐藏
dim I as long,J as boolean
j=not myformarr(0).theform.visable '所有窗体与第一个窗体对象的显示与隐藏属性相同
for i=0 to ubound(myformarr)
myformarr(i).theform.visable=j
next
end sub