Results 1 to 3 of 3

Thread: Closing of Forms.

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    5

    Closing of Forms.

    My problem is this:

    When a new form(say Form2) pops up on clicking a button on the previous form(say Form1), I need to get the Form1 closed automatically.

    I found the close method but it closes all the forms.Also there is Hide mehtod , but i dont know how to use that. Will this Hide help in solving the problem?

    Pls let me know

  2. #2
    Junior Member
    Join Date
    Sep 2003
    Posts
    26
    if form2 is called in form1 then closing form1 closes all subsequent forms.

    http://www.devcity.net/net/article.a...=multipleforms

    that link should help you.

  3. #3
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    i guess the simplest way is to use the hide and show methods, somthing like this

    Code:
     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim newform As New Form2()
            Me.Hide()
            newform.ShowDialog()
            Me.Close()
    
        End Sub

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