using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace WinUI
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Button button2;
		private System.Windows.Forms.Button buttonGenerate;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.TextBox txtItemNumber;
		private System.Windows.Forms.TextBox txtHeaderText;
		private System.Windows.Forms.Label label2;
		private DSBarCode.BarCodeCtrl barCode;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Form1()
		{
			//
			// 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.barCode = new DSBarCode.BarCodeCtrl();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.buttonGenerate = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.txtItemNumber = new System.Windows.Forms.TextBox();
            this.txtHeaderText = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // barCode
            // 
            this.barCode.BarCode = "XBOX";
            this.barCode.BarCodeHeight = 100;
            this.barCode.FooterFont = new System.Drawing.Font("Microsoft Sans Serif", 8F);
            this.barCode.HeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 18F);
            this.barCode.HeaderText = "Fahad\'s Code 39";
            this.barCode.LeftMargin = 10;
            this.barCode.Location = new System.Drawing.Point(8, 72);
            this.barCode.Name = "barCode";
            this.barCode.ShowFooter = true;
            this.barCode.ShowHeader = true;
            this.barCode.Size = new System.Drawing.Size(352, 168);
            this.barCode.TabIndex = 8;
            this.barCode.TopMargin = 10;
            this.barCode.VertAlign = DSBarCode.AlignType.Center;
            this.barCode.Weight = DSBarCode.BarCodeWeight.Small;
            // 
            // button1
            // 
            this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button1.Location = new System.Drawing.Point(16, 256);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 1;
            this.button1.Text = "Print";
            this.button1.Click += new System.EventHandler(this.button1_Click_1);
            // 
            // button2
            // 
            this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button2.Location = new System.Drawing.Point(144, 256);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 23);
            this.button2.TabIndex = 2;
            this.button2.Text = "Save";
            this.button2.Click += new System.EventHandler(this.button2_Click);
            // 
            // buttonGenerate
            // 
            this.buttonGenerate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonGenerate.Location = new System.Drawing.Point(272, 256);
            this.buttonGenerate.Name = "buttonGenerate";
            this.buttonGenerate.Size = new System.Drawing.Size(75, 23);
            this.buttonGenerate.TabIndex = 3;
            this.buttonGenerate.Text = "Generate";
            this.buttonGenerate.Click += new System.EventHandler(this.buttonGenerate_Click);
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(8, 12);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(95, 13);
            this.label1.TabIndex = 4;
            this.label1.Text = "Enter Item Number";
            // 
            // txtItemNumber
            // 
            this.txtItemNumber.Location = new System.Drawing.Point(128, 8);
            this.txtItemNumber.Name = "txtItemNumber";
            this.txtItemNumber.Size = new System.Drawing.Size(232, 20);
            this.txtItemNumber.TabIndex = 5;
            // 
            // txtHeaderText
            // 
            this.txtHeaderText.Location = new System.Drawing.Point(128, 40);
            this.txtHeaderText.Name = "txtHeaderText";
            this.txtHeaderText.Size = new System.Drawing.Size(232, 20);
            this.txtHeaderText.TabIndex = 7;
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(8, 44);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(66, 13);
            this.label2.TabIndex = 6;
            this.label2.Text = "Header Text";
            // 
            // Form1
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(368, 302);
            this.Controls.Add(this.txtHeaderText);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.txtItemNumber);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.buttonGenerate);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.barCode);
            this.Name = "Form1";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Form1";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

		}
		#endregion

//		/// <summary>
//		/// The main entry point for the application.
//		/// </summary>
//		[STAThread]
//		static void Main() 
//		{
//			Application.Run(new Form1());
//		}

		private void Form1_Load(object sender, System.EventArgs e)
		{
		 
		 
		}

		private void button1_Click_1(object sender, System.EventArgs e)
		{
			this.barCode.Print();
		}

		private void button2_Click(object sender, System.EventArgs e)
		{
			this.barCode.SaveImage("c:\\test.bmp");
		}


		private void buttonGenerate_Click(object sender, System.EventArgs e)
		{
			this.barCode.BarCode=
				this.txtItemNumber.Text;
			this.barCode.HeaderText=
				this.txtHeaderText.Text;
		}
	}
}
