⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainfrm.cs

📁 进销存
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.menuItem27.Text = "货品调库";
			// 
			// menuItem28
			// 
			this.menuItem28.Index = 3;
			this.menuItem28.Text = "报损报溢";
			// 
			// menuItem29
			// 
			this.menuItem29.Index = 4;
			this.menuItem29.Text = "下限设置";
			// 
			// menuItem17
			// 
			this.menuItem17.Index = 4;
			this.menuItem17.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					   this.menuItem18,
																					   this.menuItem2,
																					   this.menuItem3,
																					   this.menuItem4,
																					   this.menuItem5,
																					   this.menuItem6});
			this.menuItem17.Text = "系统维护";
			// 
			// menuItem18
			// 
			this.menuItem18.Index = 0;
			this.menuItem18.Text = "修改密码";
			// 
			// menuItem2
			// 
			this.menuItem2.Index = 1;
			this.menuItem2.Text = "添加用户";
			// 
			// menuItem3
			// 
			this.menuItem3.Index = 2;
			this.menuItem3.Text = "数据备份";
			// 
			// menuItem4
			// 
			this.menuItem4.Index = 3;
			this.menuItem4.Text = "数据恢复";
			// 
			// menuItem5
			// 
			this.menuItem5.Index = 4;
			this.menuItem5.Text = "系统日志";
			// 
			// menuItem6
			// 
			this.menuItem6.Index = 5;
			this.menuItem6.Text = "重新登陆";
			// 
			// menuItem19
			// 
			this.menuItem19.Index = 5;
			this.menuItem19.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					   this.menuItem32,
																					   this.menuItem33,
																					   this.menuItem34,
																					   this.menuItem35});
			this.menuItem19.Text = "系统帮助";
			// 
			// menuItem32
			// 
			this.menuItem32.Index = 0;
			this.menuItem32.Text = "记事本";
			// 
			// menuItem33
			// 
			this.menuItem33.Index = 1;
			this.menuItem33.Text = "计算器";
			// 
			// menuItem34
			// 
			this.menuItem34.Index = 2;
			this.menuItem34.Text = "使用帮助文档";
			// 
			// menuItem35
			// 
			this.menuItem35.Index = 3;
			this.menuItem35.Text = "系统信息";
			// 
			// menuItemQuit
			// 
			this.menuItemQuit.Index = 6;
			this.menuItemQuit.Text = "退出系统";
			this.menuItemQuit.Click += new System.EventHandler(this.menuItemQuit_Click);
			// 
			// MainFrm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.SystemColors.Control;
			this.ClientSize = new System.Drawing.Size(552, 313);
			this.IsMdiContainer = true;
			this.Menu = this.mainMenu;
			this.Name = "MainFrm";
			this.Text = "进销存管理";
			this.Load += new System.EventHandler(this.MainFrm_Load);

		}
		#endregion

		

		

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

		private void menuItem7_Click(object sender, System.EventArgs e)
		{
			ShowOTMany("OTMany");
		}

		private void ShowOTMany(string formName)
		{
			
			if (this.checkChildFrmExist("OTMany") == true)
			{
				return;
			}
			// 如果该窗体不存在则新生成一个进货单窗体
			OTMany newFrm = new OTMany();
			newFrm.MdiParent = this;
			newFrm.Show();		
		}
		//-----------------查询一个子窗体是否存在----------------
		private bool checkChildFrmExist(string childFrmName)
		{
			foreach(Form childFrm in this.MdiChildren)
			{
				//用子窗体的Name进行判断,如果已经存在则将他激活
				if(childFrm.Name == childFrmName)
				{
					if(childFrm.WindowState == FormWindowState.Minimized)
						childFrm.WindowState = FormWindowState.Normal;
					childFrm.Activate();
					return true;
				}
			}
			return false;
		}
		#region Show MDI Background Image

		public new bool IsMdiContainer
		{
			get{ return base.IsMdiContainer; }
			set
			{
				base.IsMdiContainer = value;

				if( ! value) return;

				for(int i = 0; i < this.Controls.Count; i++)
				{
					MdiClient mdiClient = this.Controls[i] as MdiClient;
					if(mdiClient != null)
					{
						ControlStyles styles = ControlStyles.DoubleBuffer;
					
						try
						{  // Prevent flickering, only if our assembly have reflection permission.
							Type mdiType = typeof(MdiClient);
							System.Reflection.BindingFlags flags = System.Reflection.BindingFlags.NonPublic|System.Reflection.BindingFlags.Instance;
							System.Reflection.MethodInfo method = mdiType.GetMethod("SetStyle",flags);
							object[] param= {styles, true};
							method.Invoke(mdiClient,param);
						}
						catch (System.Security.SecurityException)
						{/*Don't do anything!!! This code is running under partially trusted context*/}

						mdiClient.Paint += new PaintEventHandler(this.MdiClient_Paint);
						break;
					}
				}
			}
		}

		private void MdiClient_Paint(object sender, PaintEventArgs e)
		{
			PaintBackground(e.Graphics);
		}

		private void PaintBackground( Graphics g )
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager("OneToMany.pic",System.Reflection.Assembly.GetExecutingAssembly()); 
			Rectangle rect = this.ClientRectangle;
			rect.Inflate(2,2);

			Brush b = new SolidBrush(Color.White);
			g.FillRectangle(b, rect);
			Image backgroundImage = (Image)(resources.GetObject("pic"));
			g.DrawImage(backgroundImage, 0, 0,backgroundImage.Width, backgroundImage.Height);
		}

		#endregion

		private void mnu_StorageSearch_Click(object sender, System.EventArgs e)
		{
		if (this.checkChildFrmExist("StorageSearch") == true)
			{
				return;
			}

			// 如果该窗体不存在则新生成一个库存查询窗体
			StorageSearch newFrm = new StorageSearch();
			newFrm.MdiParent = this;
			newFrm.Show();
		}
		//-----------显示库存查询窗口----------

//		private void mnu_StorageSearch_Click(object sender, System.EventArgs e)
//		{
//			if (this.checkChildFrmExist("StorageSearch") == true)
//			{
//				return;
//			}
//			// 如果该窗体不存在则新生成一个库存查询窗体
//			StorageSearch newFrm = new StorageSearch();
//			newFrm.MdiParent = this;
//			newFrm.Show();
//		}

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

		private void mnu_StokerDataManage_Click(object sender, System.EventArgs e)
		{
			if (this.checkChildFrmExist("StokerDataManage") == true)
			{
				return;
			}
			// 如果该窗体不存在则新生成一个进货单窗体
		    StokerDataManage newFrm = new StokerDataManage();
			newFrm.MdiParent = this;
			newFrm.Show();	
		}

		private void mnu_StockTable_Click(object sender, System.EventArgs e)
		{
			if (this.checkChildFrmExist("OTMany") == true)
			{
				return;
			}
			// 如果该窗体不存在则新生成一个进货单窗体
			SupplyLookup newFrm = new SupplyLookup();
			newFrm.MdiParent = this;
			newFrm.Show();	
		}

		private void menuItemQuit_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void menuItem3_Click(object sender, System.EventArgs e)
		{
			
			changePassword newFrm = new changePassword();
			newFrm.MdiParent = this;
			newFrm.Show();
		}

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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -