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. How to switch forms?

How to switch forms?

Scheduled Pinned Locked Moved C#
helpcsharptutorialquestion
4 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.
  • M Offline
    M Offline
    MarkyMark
    wrote on last edited by
    #1

    I have an interface problem, trying to write a program in C#, which I'd really appreciate some help on. It's an SDI app, and I want basically to switch the main form to a different one. So to start with there's one form, but on editing one of the entries I want to switch to a different one, so I can lay out a different set of controls on the other form. I'm not sure how to do this in C#? I hope you can understand what I'm trying to do, and I'd appreciate any advice! Thanks, Mark

    N 1 Reply Last reply
    0
    • M MarkyMark

      I have an interface problem, trying to write a program in C#, which I'd really appreciate some help on. It's an SDI app, and I want basically to switch the main form to a different one. So to start with there's one form, but on editing one of the entries I want to switch to a different one, so I can lay out a different set of controls on the other form. I'm not sure how to do this in C#? I hope you can understand what I'm trying to do, and I'd appreciate any advice! Thanks, Mark

      N Offline
      N Offline
      naglbitur
      wrote on last edited by
      #2

      Hi. I don´t know if I have understood you correctly but here is an idea, I hope you can use it. You create another form, From f1 = new Form(); and then call the show method: f1.Show(); You can of course add the controls you like to that new form and set it´s size just like on any other form. Hope this helps, F

      M 1 Reply Last reply
      0
      • N naglbitur

        Hi. I don´t know if I have understood you correctly but here is an idea, I hope you can use it. You create another form, From f1 = new Form(); and then call the show method: f1.Show(); You can of course add the controls you like to that new form and set it´s size just like on any other form. Hope this helps, F

        M Offline
        M Offline
        MarkyMark
        wrote on last edited by
        #3

        Thanks for your reply. The problem with that is it will open a new form, what I want to do is replace the existing form with the new one. I don't know how to do it in an SDI app, in an MDI app you can open a new child form, the problem is the user can restore the forms and switch between them, I want it to appear as an SDI app.

        N 1 Reply Last reply
        0
        • M MarkyMark

          Thanks for your reply. The problem with that is it will open a new form, what I want to do is replace the existing form with the new one. I don't know how to do it in an SDI app, in an MDI app you can open a new child form, the problem is the user can restore the forms and switch between them, I want it to appear as an SDI app.

          N Offline
          N Offline
          naglbitur
          wrote on last edited by
          #4

          Hi. Perhaps you can set your existing controls (textboxes, radiobuttons etc) to disappear, you can set their property. For instance, if have a TextBox on your form, txtbox2, you can: txtbox2.Visible = false; and it will then not be seen by the user. That way you can make some or all of the controls disappear and then create new ones if need be. I don´t know if I fully understand your problem but I hope this helps. F

          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