Click here to Skip to main content
15,913,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
Hii..
I face some problems with my form codes.
I created two forms in visual studio 2005.
The First form, Form1, and the second form1.
I created a button in the first form(Form1) and then added the code below to open the 2nd form and close the 1st one, so that it acts like a broser, instead of opening so many forms and a time.
The problem is that whenever I run the program and click on the button, both of the forms close. I want the 1st one to close and the second one to open... some one helpppppppp.
The code for the 1st form is here:

VB
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()
        Form2.Show()
    End Sub
End Class
Posted
Updated 27-Mar-10 20:24pm
v2

Use Hide method instead of Close.
 
Share this answer
 
You have not posted sufficient information for anyone to be able to help you. Edit your question and post some more code - someone might be able to guide you then.
 
Share this answer
 
Ok.. I have changed the style of the Question
 
Share this answer
 
Thanks.. It works :cool::thumbsup:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900