using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.Odbc;
using System.Data.OleDb;
using System.Data.OracleClient;
using System.Data.SqlClient;

namespace Northwind
{
	/// <summary>
	/// Summary description for BeautifulForm.
	/// </summary>
	public class BeautifulForm : System.Windows.Forms.Form
	{
		internal System.Windows.Forms.Panel Panel2;
		internal System.Windows.Forms.TextBox TextBox1;
		internal System.Windows.Forms.Label Label1;
		internal System.Windows.Forms.Splitter Splitter1;
		internal System.Windows.Forms.Splitter Splitter2;
		internal System.Windows.Forms.Panel Panel1;
		internal System.Windows.Forms.TreeView TreeView1;
		internal System.Windows.Forms.ProgressBar ProgressBar1;
		internal System.Windows.Forms.StatusBar StatusBar1;
		internal System.Windows.Forms.Button Button1;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public BeautifulForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.Panel2 = new System.Windows.Forms.Panel();
			this.TextBox1 = new System.Windows.Forms.TextBox();
			this.Label1 = new System.Windows.Forms.Label();
			this.Splitter1 = new System.Windows.Forms.Splitter();
			this.Splitter2 = new System.Windows.Forms.Splitter();
			this.Panel1 = new System.Windows.Forms.Panel();
			this.TreeView1 = new System.Windows.Forms.TreeView();
			this.ProgressBar1 = new System.Windows.Forms.ProgressBar();
			this.StatusBar1 = new System.Windows.Forms.StatusBar();
			this.Button1 = new System.Windows.Forms.Button();
			this.Panel2.SuspendLayout();
			this.Panel1.SuspendLayout();
			this.SuspendLayout();
			// 
			// Panel2
			// 
			this.Panel2.Controls.Add(this.TextBox1);
			this.Panel2.Controls.Add(this.Label1);
			this.Panel2.Dock = System.Windows.Forms.DockStyle.Top;
			this.Panel2.Location = new System.Drawing.Point(131, 3);
			this.Panel2.Name = "Panel2";
			this.Panel2.Size = new System.Drawing.Size(261, 168);
			this.Panel2.TabIndex = 13;
			// 
			// TextBox1
			// 
			this.TextBox1.Location = new System.Drawing.Point(112, 72);
			this.TextBox1.Name = "TextBox1";
			this.TextBox1.TabIndex = 1;
			this.TextBox1.Text = "TextBox1";
			// 
			// Label1
			// 
			this.Label1.Location = new System.Drawing.Point(8, 80);
			this.Label1.Name = "Label1";
			this.Label1.TabIndex = 0;
			this.Label1.Text = "Label1";
			// 
			// Splitter1
			// 
			this.Splitter1.Location = new System.Drawing.Point(128, 3);
			this.Splitter1.Name = "Splitter1";
			this.Splitter1.Size = new System.Drawing.Size(3, 357);
			this.Splitter1.TabIndex = 12;
			this.Splitter1.TabStop = false;
			// 
			// Splitter2
			// 
			this.Splitter2.Dock = System.Windows.Forms.DockStyle.Top;
			this.Splitter2.Location = new System.Drawing.Point(128, 0);
			this.Splitter2.Name = "Splitter2";
			this.Splitter2.Size = new System.Drawing.Size(264, 3);
			this.Splitter2.TabIndex = 14;
			this.Splitter2.TabStop = false;
			// 
			// Panel1
			// 
			this.Panel1.Controls.Add(this.TreeView1);
			this.Panel1.Dock = System.Windows.Forms.DockStyle.Left;
			this.Panel1.Location = new System.Drawing.Point(0, 0);
			this.Panel1.Name = "Panel1";
			this.Panel1.Size = new System.Drawing.Size(128, 360);
			this.Panel1.TabIndex = 11;
			// 
			// TreeView1
			// 
			this.TreeView1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.TreeView1.ImageIndex = -1;
			this.TreeView1.Location = new System.Drawing.Point(0, 0);
			this.TreeView1.Name = "TreeView1";
			this.TreeView1.SelectedImageIndex = -1;
			this.TreeView1.Size = new System.Drawing.Size(128, 360);
			this.TreeView1.TabIndex = 0;
			// 
			// ProgressBar1
			// 
			this.ProgressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.ProgressBar1.Location = new System.Drawing.Point(200, 328);
			this.ProgressBar1.Name = "ProgressBar1";
			this.ProgressBar1.Size = new System.Drawing.Size(184, 23);
			this.ProgressBar1.TabIndex = 10;
			// 
			// StatusBar1
			// 
			this.StatusBar1.Location = new System.Drawing.Point(0, 360);
			this.StatusBar1.Name = "StatusBar1";
			this.StatusBar1.Size = new System.Drawing.Size(392, 22);
			this.StatusBar1.TabIndex = 9;
			this.StatusBar1.Text = "StatusBar1";
			// 
			// Button1
			// 
			this.Button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.Button1.Location = new System.Drawing.Point(248, 296);
			this.Button1.Name = "Button1";
			this.Button1.Size = new System.Drawing.Size(136, 23);
			this.Button1.TabIndex = 8;
			this.Button1.Text = "Do Some Long Process";
			this.Button1.Click += new System.EventHandler(this.Button1_Click);
			// 
			// BeautifulForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(392, 382);
			this.Controls.Add(this.Panel2);
			this.Controls.Add(this.Splitter1);
			this.Controls.Add(this.Splitter2);
			this.Controls.Add(this.Panel1);
			this.Controls.Add(this.ProgressBar1);
			this.Controls.Add(this.StatusBar1);
			this.Controls.Add(this.Button1);
			this.Name = "BeautifulForm";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "BeautifulForm";
			this.Panel2.ResumeLayout(false);
			this.Panel1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		private void Button1_Click(object sender, System.EventArgs e)
		{
			DoSomeLongProcess();
		}

		private void DoSomeLongProcess()
		{
			try
			{
				this.Cursor = Cursors.WaitCursor;
				StatusBar1.Text = "Long process running...";
				for(int i=1;i < 5000000;i++)
					ProgressBar1.Value = (i / 5000000) * 100;
            
				StatusBar1.Text = "Long process done";
			}
			finally
			{
				this.Cursor = Cursors.Default;
			}
		}
	}
}
