我来拿这100分,HOHO'类模块Class1 public withevents theForm as form'在类里面处理事件'窗体中,设已经有一个做好的源窗体frmSource,用于LOAD '公共区声明 dim myFormArr() as class1 private sub form_load() redim myformarr(0) end subprivate 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 subprivate 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 反正思路大约是这样,如果有些地方打错了你应该能调试出来......
set myformarr(i).theform=new frmSource '加载并赋值我生成了一个form2 set myformarr(i).theform=new form2 但报91错误,对象变量没有设置
public withevents theForm as form'在类里面处理事件'窗体中,设已经有一个做好的源窗体frmSource,用于LOAD
'公共区声明
dim myFormArr() as class1 private sub form_load()
redim myformarr(0)
end subprivate 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 subprivate 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
反正思路大约是这样,如果有些地方打错了你应该能调试出来......
set myformarr(i).theform=new form2
但报91错误,对象变量没有设置