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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. 3 forms - how to click button to go to each one

3 forms - how to click button to go to each one

Scheduled Pinned Locked Moved C#
tutorial
3 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.
  • J Offline
    J Offline
    johnnysmith1
    wrote on last edited by
    #1

    Hello, I have 3 forms and 1 button on each one. (form1, form2, form3) how to code the buttons to go to each form. I know basically I have to create instance of form and also show and hide. but don't really understand. I tried writing form2 newOne = new Form2(); newOne.show(); this.hide(); I was able to click button from Form1 to Form2 but that was all - even when tried to modify. I must be not doing something. thank you

    C 1 Reply Last reply
    0
    • J johnnysmith1

      Hello, I have 3 forms and 1 button on each one. (form1, form2, form3) how to code the buttons to go to each form. I know basically I have to create instance of form and also show and hide. but don't really understand. I tried writing form2 newOne = new Form2(); newOne.show(); this.hide(); I was able to click button from Form1 to Form2 but that was all - even when tried to modify. I must be not doing something. thank you

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

      Sounds like you need to read a beginners book. What you've done, kind of works. But, it's not ideal. Ideally, you have your forms as member variables, and if you want to show one and hide the other, the best way to do that is to make them both controls inside the one form.

      Christian Graus Driven to the arms of OSX by Vista. Please read this[^] if you don't like the answer I gave to your question. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.

      J 1 Reply Last reply
      0
      • C Christian Graus

        Sounds like you need to read a beginners book. What you've done, kind of works. But, it's not ideal. Ideally, you have your forms as member variables, and if you want to show one and hide the other, the best way to do that is to make them both controls inside the one form.

        Christian Graus Driven to the arms of OSX by Vista. Please read this[^] if you don't like the answer I gave to your question. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.

        J Offline
        J Offline
        johnnysmith1
        wrote on last edited by
        #3

        Thank you for the information

        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