Solved

C# - Smooth transition from Form1 to Form2

Posted on 2007-04-10
3
2,407 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Suggested Courses

752 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