/////////////////////////
//C# Form Load Sequence
//コンソールプログラムと
//して実行して下さい。
/////////////////////////

using	System;
using	System.Windows.Forms;

public partial class Form1 : Form
{
	public static void Main()
	{
		Console.WriteLine("C# Formの生成から消滅までの経過を表示します。\r\n－－－開始－－－");
		Form1 f = new Form1();
		Application.Run(f);
		Console.WriteLine("－－－終了－－－");
		Console.ReadKey();
	}

	public Form1()
	{
		this.Load += Form1_Load;
		this.Activated += Form1_Activated;
		this.Shown += Form1_Shown;
		this.Deactivate += Form1_Deactivate;
		this.Closing += Form1_Closing;
		this.FormClosing += Form1_FormClosing;
		this.FormClosed += Form1_FormClosed;
	}

	private void Form1_Load(object sender, EventArgs e)
	{
		Console.WriteLine(DateTime.Now + " Form1_Load");
	}

	private void Form1_Activated(object sender, EventArgs e)
	{
		Console.WriteLine(DateTime.Now + "Form1_Activated");
	}

	private void Form1_Shown(object sender, EventArgs e)
	{
		Console.WriteLine(DateTime.Now + " Form1_Shown");
	}

	private void Form1_Deactivate(object sender, EventArgs e)
	{
		Console.WriteLine(DateTime.Now + " Form1_Deactivate");
	}

	private void Form1_Closing(object sender, EventArgs e)
	{
		Console.WriteLine(DateTime.Now + " Form1_Closing - Closing is no longer recommended for use.");
	}

	private void Form1_FormClosing(object sender, FormClosingEventArgs e)
	{
		Console.WriteLine(DateTime.Now + " Form1_FormClosing");
	}

	private void Form1_FormClosed(object sender, FormClosedEventArgs e)
	{
		Console.WriteLine(DateTime.Now + " Form1_FormClosed");
	}
}
