Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Open a Project, then close another one??

Open a Project, then close another one??

Scheduled Pinned Locked Moved C#
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    luckyShek
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • L luckyShek

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups