请问如何在Form_Load()时判断条件不符合时Unload 本窗体。

解决方案 »

  1.   

    if 条件="条件" then
       unload me
    end if
      

  2.   

    不打明白你的意思?Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
        If MsgBox("真的要退出吗?", vbYesNo + vbQuestion + vbDefaultButton2, "请确认") = vbNo Then Cancel = True
    End SubPrivate Sub mExit_Click()
        Unload Me
    End Sub
      

  3.   

    Private Sub Form_Load()
        If 1 > 0 Then
            Unload Me
        End If
    End Sub
      

  4.   

    判断后再决定是否加载,这样可以提高速度和效率。
    不用form_load.用form_activate()