Solved

C# - Smooth transition from Form1 to Form2

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

772 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