티스토리 뷰

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Windows.Forms;


namespace test_Console_N_Window_HdlEvt

{

    class MainApp : System.Windows.Forms.Form

    {

        static void Main(string[] args)

        {

            MainApp form = new MainApp();


            form.Click += new EventHandler(

                (sender, eventArgs) =>

                {

                    Console.WriteLine("Closing Window..");

                Application.Exit();

                });


            Console.WriteLine("Startin window app");

          Application.Run(form);


            Console.WriteLine("Exit window app");

        }

    }

}


form 상속 받고, application 을 돌린 후, click event 가 발생할때까지 application 실행.

댓글
댓글쓰기 폼