open a form closing the opener
-
I have 2 forms. When I click on a button of form 1 I want to open form 2 and close form1. The problem comes when form 2 closes when form 1 closes. One solution will be to define a class and define the forms in it and not in the form 1, but I don't know how to do it. Someone can help me to do this or give me another solution? Thank you
-
I have 2 forms. When I click on a button of form 1 I want to open form 2 and close form1. The problem comes when form 2 closes when form 1 closes. One solution will be to define a class and define the forms in it and not in the form 1, but I don't know how to do it. Someone can help me to do this or give me another solution? Thank you
Why are you trying to do this? Is there a form 0? If so, you can have form 1 send a message to form 0 to open form 2. If there is no form 0, then form 1 is the main form, and when it closes, the application closes. This is why form 2 closes, too. If you want app 1 to close, try making form 2 a separate app, and execute it from app 1. Roy.
-
I have 2 forms. When I click on a button of form 1 I want to open form 2 and close form1. The problem comes when form 2 closes when form 1 closes. One solution will be to define a class and define the forms in it and not in the form 1, but I don't know how to do it. Someone can help me to do this or give me another solution? Thank you
hi dear, i can help u out. create a module . in the module create a main function module a sub main() dim f as new form1 f.showDialog() end sub end module and procedd in the same way as u were doing . the onlu thing u need to change now is ur startup object . set the startup object of the project to sub main and not to any form (Vinit Jain)
-
hi dear, i can help u out. create a module . in the module create a main function module a sub main() dim f as new form1 f.showDialog() end sub end module and procedd in the same way as u were doing . the onlu thing u need to change now is ur startup object . set the startup object of the project to sub main and not to any form (Vinit Jain)
Thanks to both, but it doesn't work. In 2005 express edition I can't (or don't know) select "sub main" as the startup object.
Roy Heil wrote:
Why are you trying to do this?
How you work with multiple forms then without using an mdi environement?
-
Thanks to both, but it doesn't work. In 2005 express edition I can't (or don't know) select "sub main" as the startup object.
Roy Heil wrote:
Why are you trying to do this?
How you work with multiple forms then without using an mdi environement?
hi ok u r working on .net 2005 express edition. i told u the code that would work in .net 2003. for dot net 2005 u dont hv to wory at all . in the properties of the project u have to set the shutdown mode of the application to "when the last form closes" karan jain
-
hi ok u r working on .net 2005 express edition. i told u the code that would work in .net 2003. for dot net 2005 u dont hv to wory at all . in the properties of the project u have to set the shutdown mode of the application to "when the last form closes" karan jain
OK!! this works well!! There is any inconvenience doing this?