-
I would like som help to close form1 as you open form2.
Form2 myForm = new Form2(); myForm.Show(); -
I would like to know how to communicate between forms, like sending integers between?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Forms are just classes. When you say
Form2 myForm = new Form2();you just create a new instance of a class. You communicate to an object (the instance of a class) by calling its methods, setting its properties or raising its events. No magic here.In particular when you say
myForm.Show(), you have already communicated to the other form. You just didn’t realize it. It just so happened, that your Form2 class has had a method called Show, so it worked. But you can create your own methods and call them in the same way.