要关闭所有窗口用如下方法:
Dim i as Integer
for i=0 to Forms.Count-1
unload Forms(i)
nextOK?
[email protected]

解决方案 »

  1.   

    在form_unload 中鍵入﹕dim f as form 
    for each f in forms 
       unload f
    next 
      

  2.   

    这样:
    将登录window留下:
    (假设保留窗口name=frmLogin
    dim i as Interger 
    for i=0 to Forms.Count-1
         if not typeof Forms(i) is frmLogin then unload forms(i)
    next
    frmlogin.show
      

  3.   

    应该这样用:
    Dim i as Integerfor i= Forms.Count-1  to 1 Step -1
       '//注意:不能从0开始,因为第0号窗体就是MDI窗体
       '//也必须从最后一个窗体开始卸载,否则会出现下标越界的问题
        unload Forms(i)
    next
      

  4.   

    应该这样用:
    Dim i as Integerfor i= Forms.Count-1  to 1 Step -1
       '//注意:不能从0开始,因为第0号窗体就是MDI窗体
       '//也必须从最后一个窗体开始卸载,否则会出现下标越界的问题
        unload Forms(i)
    next