Solved

C# - Smooth transition from Form1 to Form2

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now