我建了两个窗体form1和form2,form1中有两个frame,form2是登录窗体,点击form2
中的ok按钮,使form2消失同时form1中的frame1显示,怎么实现??

解决方案 »

  1.   

    '在Form2中
    Private Sub Form_Unload(Cancel As Integer)
        Form1.Show
        Form1.frame1.Visible=True
        Unload Me
    End Sub
      

  2.   

    Option ExplicitPrivate Sub Command1_Click()
        Form2.Frame1.Visible = True
        Form2.Frame2.Visible = False
        Unload Me
    End SubPrivate Sub Command2_Click()
        Form2.Frame2.Visible = True
        Form2.Frame1.Visible = False
        Unload Me
    End SubPrivate Sub Form_Unload(Cancel As Integer)
        Form2.Show
    End Sub
      

  3.   

    楼上的chewinggum(口香糖·向星星前进) ,应该是没看清楚题目吧!按Rick110AAA(海牛猪猪) 说的去做就可以,也可以参考这个:Private Sub Command1_Click()
        Form1.Frame1.Visible = True
        Form1.Frame2.Visible = False
        Form1.Show
        Unload Me
    End Sub
      

  4.   

    忘了说句,是把这段代码加到Form2 的OK 按钮里面!
      

  5.   

    Private Sub Ok_Click()
        Form1.show
        Form1.Frame1.visible = True
        Form1.Frame2.visible = False
        Unload me
    End Sub
      

  6.   

    private sub commandok_click()
        form1.frame1.visible=true
        form1.show
        unload form2
    end sub
      

  7.   

    '在Form2中
    Private Sub Form_Unload(Cancel As Integer)
        Form1.Show
        Form1.frame1.Visible=True
        Unload Me
    End Sub