Results 1 to 2 of 2

Thread: [Resolved]How to close the mdiform with childform ? thanks for help :=)

  1. #1

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Smile [Resolved]How to close the mdiform with childform ? thanks for help :=)

    Hi ,

    I would like to close the mdiform by childform. how can i do it ?

    Example, i want to do the log off function. when the user click on log off. all application will close up and load the login form.The log off action from childform instead of parentform.

    My coding as below :

    Code:
    dim A as new mdiform 
    dim B as new form1 'Not childform
    
    B.show()
    A.hide()
    Last edited by nUflAvOrS; Jul 25th, 2007 at 06:21 AM.

  2. #2
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: [Resolved]How to close the mdiform with childform ? thanks for help :=)

    I'm not entirely sure that I understand fully but I think you are asking this.

    Open a new child form from the MdiParent:
    Code:
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim f As New Form2()
            f.MdiParent = Me
            f.Show()
        End Sub
    End Class
    Open a form from that child that is not a child form and then hide everything else:
    Code:
    Public Class Form2
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim f As New Form3()
            f.Show()
            Me.Parent.Parent.Hide()
        End Sub
    End Class
    Hope that helps a little...if I got the question right.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width