Jump to content

  •  

  • iBotModz CBox


    Photo

    (C#) Show Another Form


    • Please log in to reply
    6 replies to this topic

    #1 Dark Slipstream

    Dark Slipstream

      Blue Shadowz Owner

    • Members+

    • 2,829 posts
    • Joined: 19-April 08
    • Gender:Male
    • Location:Canada, ON

    Posted 11 May 2009 - 09:31 PM

    Removed.

    Edited by Dark Slipstream, 16 August 2009 - 10:56 PM.


    #2 EsjayIzBack

    EsjayIzBack

      Private

    • Members+

    • 25 posts
    • Joined: 04-May 09

    Posted 11 May 2009 - 10:03 PM

    You could use

    Form1 Form1 = new Form1();
    Form1.Show();

    Replacing Form1 with the name of the form you want to pop up. This is pretty much the same as yours, but you didn't really clarify yours. Also, make sure that you have correct capitalization.

    Edited by EsjayIzBack, 11 May 2009 - 10:05 PM.


    #3 Dark Slipstream

    Dark Slipstream

      Blue Shadowz Owner

    • Members+

    • 2,829 posts
    • Joined: 19-April 08
    • Gender:Male
    • Location:Canada, ON

    Posted 11 May 2009 - 10:05 PM

    I replaced newForm with Form1, but you shouldn't assign Form1 to Form1, that can arise to problems.

    #4 iBotPeaches

    iBotPeaches

      General Grade 6

    • Owner

    • 6,570 posts
    • Joined: 29-July 07
    • Gender:Male
    • Location:Kansas

    Posted 12 May 2009 - 05:16 AM

    When I do mine I do

    intro intro = new intro();
    intro.Show();

    I assume that will get errors some time. If my form name is (intro) that I want to appear which do I change and which do I leave?

    #5 Dark Slipstream

    Dark Slipstream

      Blue Shadowz Owner

    • Members+

    • 2,829 posts
    • Joined: 19-April 08
    • Gender:Male
    • Location:Canada, ON

    Posted 12 May 2009 - 08:30 AM

    intro in = new intro();
    intro.Show();

    Make it look like that. This way it won't error.

    If you are using namespaces in your project, don't worry about changing it.

    #6 EsjayIzBack

    EsjayIzBack

      Private

    • Members+

    • 25 posts
    • Joined: 04-May 09

    Posted 12 May 2009 - 03:21 PM

    I replaced newForm with Form1, but you shouldn't assign Form1 to Form1, that can arise to problems.


    I was just using Form1 as an example.

    #7 yungbol

    yungbol

      Firmware Expert

    • Global Mods

    • 1,461 posts
    • Joined: 09-April 08
    • Gender:Male
    • Location:Philly

    Posted 13 May 2009 - 01:03 PM

    I right click to create mines, name it "Example.cs", add what I want it to look like. Then I just add the following:

    //First make the current form disappear.
    this.Visible = false;
    
    //Now create a new form
    Example e = new Example();
    e.Show();