how to close a form at runtime in a window application

Hi experts,

my question is that As i click ona button the following should be happen

1.a form should be open that .this form will be there for almost 3-4 second on screen after this ,that form will be closed.
2. As it close a new form will be opened.

how could we done it in c# window applicatiopn.

Please let me know about it ASAP.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

it;s a problem if it's made in delphi?
ASINGH1974Author Commented:
actually i want this functionality in c#, window application
Just so i understand, for example:

from Form1, you press a button
that opens Form2, which lingers for 4 seconds
when it closes, it launches Form3?
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

ASINGH1974Author Commented:
yes, you are saying right.
i want this type of functionality
Okay, should be done the easiest with a timer.
In Form1 on the button click, launch Form2 as you would any other:

private void button1_Click(object sender, EventArgs e)
    new Form2().Show();

Then in add an event for the Form2 Load in it's code behind, and hook up as follows:

private void Form2_Load(object sender, EventArgs e)
    //create a timer for the 4 second delay and wire up and event handler for the tick event
    Timer t = new Timer();
    t.Interval = 4000;
    t.Tick += new EventHandler(Timer_Tick);
protected void Timer_Tick(object sender, EventArgs e)
    //on the tick event, kill the timer, make this form invisible, launch the 3rd form, and then close this one
    this.Visible = false;
    new Form3().Show();

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ASINGH1974Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.