using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
//using  AxMSHierarchicalFlexGridLib.AxMSHFlexGrid ;

namespace GridTest
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private ljs.MyFlexGrid myFlexGrid1;
		private System.Windows.Forms.MainMenu mainMenu;
		private System.Windows.Forms.MenuItem Mmnu_Copy;
		private System.Windows.Forms.MenuItem Mmnu_Paste;
		private System.Windows.Forms.MenuItem Mmnu_File;
		private System.Windows.Forms.MenuItem Mmnu_Help;
		private System.Windows.Forms.MenuItem Mmnu_About;
		private AxMSHierarchicalFlexGridLib.AxMSHFlexGrid axMSHFlexGrid1;
		private ljs.MyFlexGrid myFlexGrid2;
		private ljs.MyFlexGrid myFlexGrid3;
		private ljs.MyFlexGrid myFlexGrid4;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Form1()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
			this.mainMenu = new System.Windows.Forms.MainMenu();
			this.Mmnu_File = new System.Windows.Forms.MenuItem();
			this.Mmnu_Copy = new System.Windows.Forms.MenuItem();
			this.Mmnu_Paste = new System.Windows.Forms.MenuItem();
			this.Mmnu_Help = new System.Windows.Forms.MenuItem();
			this.Mmnu_About = new System.Windows.Forms.MenuItem();
			this.axMSHFlexGrid1 = new AxMSHierarchicalFlexGridLib.AxMSHFlexGrid();
			this.myFlexGrid2 = new ljs.MyFlexGrid();
			this.myFlexGrid3 = new ljs.MyFlexGrid();
			this.myFlexGrid4 = new ljs.MyFlexGrid();
			((System.ComponentModel.ISupportInitialize)(this.axMSHFlexGrid1)).BeginInit();
			this.SuspendLayout();
			// 
			// mainMenu
			// 
			this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					 this.Mmnu_File,
																					 this.Mmnu_Help});
			// 
			// Mmnu_File
			// 
			this.Mmnu_File.Index = 0;
			this.Mmnu_File.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.Mmnu_Copy,
																					  this.Mmnu_Paste});
			this.Mmnu_File.Text = "文件";
			// 
			// Mmnu_Copy
			// 
			this.Mmnu_Copy.Index = 0;
			this.Mmnu_Copy.Text = "复制";
			// 
			// Mmnu_Paste
			// 
			this.Mmnu_Paste.Index = 1;
			this.Mmnu_Paste.Text = "粘贴";
			this.Mmnu_Paste.Click += new System.EventHandler(this.menuItem3_Click);
			// 
			// Mmnu_Help
			// 
			this.Mmnu_Help.Index = 1;
			this.Mmnu_Help.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.Mmnu_About});
			this.Mmnu_Help.Text = "帮助";
			// 
			// Mmnu_About
			// 
			this.Mmnu_About.Index = 0;
			this.Mmnu_About.Text = "关于";
			// 
			// axMSHFlexGrid1
			// 
			this.axMSHFlexGrid1.DataSource = null;
			this.axMSHFlexGrid1.Location = new System.Drawing.Point(14, 66);
			this.axMSHFlexGrid1.Name = "axMSHFlexGrid1";
			this.axMSHFlexGrid1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMSHFlexGrid1.OcxState")));
			this.axMSHFlexGrid1.Size = new System.Drawing.Size(392, 72);
			this.axMSHFlexGrid1.TabIndex = 1;
			// 
			// myFlexGrid2
			// 
			this.myFlexGrid2.BorderStyle = false;
			this.myFlexGrid2.CellBackColor = System.Drawing.Color.White;
			this.myFlexGrid2.CellColLength = 0;
			this.myFlexGrid2.CellForeColor = System.Drawing.Color.Black;
			this.myFlexGrid2.CellLocked = false;
			this.myFlexGrid2.CellRowLength = 0;
			this.myFlexGrid2.CellTag = null;
			this.myFlexGrid2.Col = 0;
			this.myFlexGrid2.Cols = 2;
			this.myFlexGrid2.DetailFormat = null;
			this.myFlexGrid2.EnterToTab = true;
			this.myFlexGrid2.FormatString = null;
			this.myFlexGrid2.FormatString1 = null;
			this.myFlexGrid2.GridStyle = true;
			this.myFlexGrid2.Location = new System.Drawing.Point(152, 72);
			this.myFlexGrid2.Name = "myFlexGrid2";
			this.myFlexGrid2.Row = 0;
			this.myFlexGrid2.Rows = 2;
			this.myFlexGrid2.SetCellWidth = "100,100";
			this.myFlexGrid2.Size = new System.Drawing.Size(344, 208);
			this.myFlexGrid2.TabIndex = 2;
			this.myFlexGrid2.Cell_MouseDown += new ljs.FlexGridCell_MouseDown(this.myFlexGrid2_Cell_MouseDown);
			// 
			// myFlexGrid3
			// 
			this.myFlexGrid3.BorderStyle = false;
			this.myFlexGrid3.CellBackColor = System.Drawing.Color.White;
			this.myFlexGrid3.CellColLength = 0;
			this.myFlexGrid3.CellForeColor = System.Drawing.Color.Black;
			this.myFlexGrid3.CellLocked = false;
			this.myFlexGrid3.CellRowLength = 0;
			this.myFlexGrid3.CellTag = null;
			this.myFlexGrid3.Col = 0;
			this.myFlexGrid3.Cols = 2;
			this.myFlexGrid3.DetailFormat = null;
			this.myFlexGrid3.EnterToTab = true;
			this.myFlexGrid3.FormatString = null;
			this.myFlexGrid3.FormatString1 = null;
			this.myFlexGrid3.GridStyle = true;
			this.myFlexGrid3.Location = new System.Drawing.Point(74, 40);
			this.myFlexGrid3.Name = "myFlexGrid3";
			this.myFlexGrid3.Row = 0;
			this.myFlexGrid3.Rows = 2;
			this.myFlexGrid3.SetCellWidth = null;
			this.myFlexGrid3.Size = new System.Drawing.Size(260, 176);
			this.myFlexGrid3.TabIndex = 3;
			// 
			// myFlexGrid4
			// 
			this.myFlexGrid4.BorderStyle = false;
			this.myFlexGrid4.CellBackColor = System.Drawing.Color.White;
			this.myFlexGrid4.CellColLength = 0;
			this.myFlexGrid4.CellForeColor = System.Drawing.Color.Black;
			this.myFlexGrid4.CellLocked = false;
			this.myFlexGrid4.CellRowLength = 0;
			this.myFlexGrid4.CellTag = null;
			this.myFlexGrid4.Col = 0;
			this.myFlexGrid4.Cols = 2;
			this.myFlexGrid4.DetailFormat = null;
			this.myFlexGrid4.EnterToTab = true;
			this.myFlexGrid4.FormatString = null;
			this.myFlexGrid4.FormatString1 = null;
			this.myFlexGrid4.GridStyle = true;
			this.myFlexGrid4.Location = new System.Drawing.Point(150, 130);
			this.myFlexGrid4.Name = "myFlexGrid4";
			this.myFlexGrid4.Row = 3;
			this.myFlexGrid4.Rows = 2;
			this.myFlexGrid4.SetCellWidth = null;
			this.myFlexGrid4.Size = new System.Drawing.Size(242, 188);
			this.myFlexGrid4.TabIndex = 4;
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(438, 325);
			this.Controls.Add(this.myFlexGrid4);
			this.Controls.Add(this.myFlexGrid3);
			this.Controls.Add(this.myFlexGrid2);
			this.Controls.Add(this.axMSHFlexGrid1);
			this.Menu = this.mainMenu;
			this.Name = "Form1";
			this.Text = "test";
			this.Resize += new System.EventHandler(this.Form1_Resize);
			this.Load += new System.EventHandler(this.Form1_Load);
			((System.ComponentModel.ISupportInitialize)(this.axMSHFlexGrid1)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}

		private void Form1_Resize(object sender, System.EventArgs e)
		{
			myFlexGrid1.Width =this.Width ;
			myFlexGrid1.Height =this.Height-100 ;
		}
//
		private void Form1_Load(object sender, System.EventArgs e)
		{
           myFlexGrid1.Rows=20;
//			myFlexGrid1.CellLocked =true;
		     myFlexGrid1.FormatString ="0序号|1产品代码|2产品名称|3产品型号|4需方型号|5包装形式|6最小包装量|7单位|8仓库|入库|入库|入库|入库|出库|出库|出库|库存数量|17平均单价|18金额|19|20|21|22|23|24  |25   |26    |27     ";
			myFlexGrid1.FormatString1 ="0序号|1产品代码|2产品名称|3产品型号|4需方型号|5包装形式|6最小包装量|7单位|8仓库|9入库日期|10入库数量|11入库单价|12入库金额|13出库数量|14出库单价|15出库金额|16库存数量|17平均单价|18金额|19|20|21|22|23|24  |25   |26    |27     ";
//            myFlexGrid1.GetCell
			
			//		int r;
//		r=myFlexGrid1;
		
		}

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

		private void myFlexGrid2_Cell_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
		{
		
		}
	}
}
