I am creating C#.net(4.0) application.This application is a Console Application and I am creating a Window Form in this application with two button start and cancel.
From the main Function I am calling the form : Application.Run(new Form());
Now the form contains two buttons :
Start Button-On start button click I am doing some task.
Task1(); Task2();
Cancel Button-On Cancel button click I want to terminate application.
Application.Exit() //is called on Cancel Button click.
The problem is as I start the application and click cancel button application terminates, but when I press start button and then press cancel button the application doesn't terminate..