Solved

C# - Smooth transition from Form1 to Form2

Posted on 2007-04-10
3
2,430 Views
Last Modified: 2010-05-18
Hi guys 'n gals,

Does anybody know any methods I could use to swap from Form1 to Form2, in a fast smooth method which will prevent the user from even knowing there is more than one Form? I do not want to close Form1, I merely want to hide it while showing Form2.

Any thoughts?

Cheers!
0
Comment
Question by:Cyber-Drugs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Expert Comment

by:Yttribium
ID: 18890438
Can try:

inside the parentform:
                  this.Visible = false;
                  PopForm frm2 = new PopForm(this);
                  frm2.ShowDialog(this);
                  this.Visible = true;

(created a Form called PopForm for testing)
0
 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 18896167
Hey,

Cheers for the idea, but I'm trying to move from Form1 to Form2, tried your code like this:

                this.Visible = false;
                Form2 frm2 = new Form2(this);
                frm2.ShowDialog(this);
                this.Visible = true;


and I get this error:


Error      1      No overload for method 'Form2' takes '1' arguments      C:\Documents and Settings\Justin Nel\My Documents\Visual Studio 2005\Projects\CartoLogix\CartoLogix\Form1.cs      375      30      CartoLogix
0
 
LVL 5

Accepted Solution

by:
Yttribium earned 500 total points
ID: 18897054
Yeah, remove the parameter for Form2(this), to Form2(), I forgot about that, (in my test, I had an extra overloaded constructor)

    this.Visible = false;
                Form2 frm2 = new Form2(); //oops :P
                frm2.ShowDialog(this);
                this.Visible = true;
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question