Close a form from another form?
-
-
Hello everyone, I have two windows forms, form1 has a close button that I would like to use to close not only form1 but also form2 at the same time if form2 is open. Is there a way to do this cause I cannot find anything that can help me with this?
-
Hello everyone, I have two windows forms, form1 has a close button that I would like to use to close not only form1 but also form2 at the same time if form2 is open. Is there a way to do this cause I cannot find anything that can help me with this?
-
Oh, on your button click event, you do all those things. me.close form2.close this will close two forms and will leave other running forms,if you have any. kagiso
-
Hello everyone, I have two windows forms, form1 has a close button that I would like to use to close not only form1 but also form2 at the same time if form2 is open. Is there a way to do this cause I cannot find anything that can help me with this?
-
Thanks guys, I'll try all of them cause I will need to exit certain forms only and also eventually the aplication in the end. Got two answers for the $0.00 price of one. ;)
Well I tried these suggestions and all I kept getting is that there was no instance set to an object and I've tried it many different ways and nothing BUT, I did find this article about Singletons which is letting me do exactly what I want. :) So for anyone that is having toubles like this here a good place to start looking >> http://www.codeproject.com/vb/net/Simple_Singleton_Forms.asp[^]