CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Posts
    30

    Dealing with multiple forms

    Hello all,


    I'm trying to write an application in C#.NET (Visual Studio 2002), that deals with multiple windows, a bit like the wizards do, that is with a "Next" button etc.

    I'd like to be able to close one form and show another one when clicking on a button. I tried calling Application.Run() without a Form nor ApplicationContext parameter, and calling Form.Show() for both forms sequentially.

    I also tried creating my own ApplicationContext and changing the MainForm property in the Button_Clicked() event, or in the Form_Closed() one, and several different variations without success.

    I can't find posts on this topic in the forum. I'd be grateful if someone could help me with this!

    Thanks,
    Maxime

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125
    You probably dont want to do what you want to do...

    Keep it simple. Use a single form. Instanciate different controls for the different pages.

    Much easier!
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured