Open a Project, then close another one??
-
hi there, I have a Solution with two projects. Both projects have a main method to open its own. - projectA - formA(with a main() method) - buttonA Solution - projectB - formB(with a main() method) - buttonB I want to open formB in projectB by clicking buttonA. private void buttonA_click(){ projectB.formB fb = new projectB.formB(); fb.Show(); // open projectB this.Visible = false; // close projectA this.Dispose(); } But," this.Visible = false; and this.Dispose();" statements cause both projects closed. 1) how can Open a Project, then close another one by not using " this.Visible = false; and this.Dispose();" ?? Thansks
-
hi there, I have a Solution with two projects. Both projects have a main method to open its own. - projectA - formA(with a main() method) - buttonA Solution - projectB - formB(with a main() method) - buttonB I want to open formB in projectB by clicking buttonA. private void buttonA_click(){ projectB.formB fb = new projectB.formB(); fb.Show(); // open projectB this.Visible = false; // close projectA this.Dispose(); } But," this.Visible = false; and this.Dispose();" statements cause both projects closed. 1) how can Open a Project, then close another one by not using " this.Visible = false; and this.Dispose();" ?? Thansks
luckyShek wrote: this.Visible = false; // close projectA This hides child windows as well, such as the one you created. luckyShek wrote: this.Dispose(); Oh, someone shoot me. projectB exists as an instance inside projectA. What did you expect this would do ? You probably want to use ShellExecute to just run the other program, then close this one. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer