?
Solved

C# - Smooth transition from Form1 to Form2

Posted on 2007-04-10
3
Medium Priority
?
2,463 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

719 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