📄 frmmain.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace bggl.fm
{
/// <summary>
/// frmmain 的摘要说明。
/// </summary>
public class frmmain : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItem5;
private System.Windows.Forms.MenuItem menuItem6;
private System.Windows.Forms.MenuItem menuItem7;
private System.Windows.Forms.MenuItem menuItem11;
private System.Windows.Forms.MenuItem menuItem12;
private System.Windows.Forms.MenuItem menuItem13;
private System.Windows.Forms.MenuItem menuItem14;
private System.Windows.Forms.MenuItem menuItem15;
private System.Windows.Forms.MenuItem menuItem16;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ToolBarButton toolBarButton1;
private System.Windows.Forms.ToolBarButton toolBarButton3;
private System.Windows.Forms.ToolBarButton toolBarButton4;
private System.Windows.Forms.ToolBarButton toolBarButton5;
private System.Windows.Forms.MenuItem menuItem17;
private System.Windows.Forms.MenuItem menuItem10;
private System.Windows.Forms.MenuItem menuItem18;
private System.ComponentModel.IContainer components;
Form dl;
public frmmain(Form z)
{
//
// Windows 窗体设计器支持所必需的
//
dl=z;
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()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmmain));
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.menuItem18 = new System.Windows.Forms.MenuItem();
this.menuItem5 = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.menuItem7 = new System.Windows.Forms.MenuItem();
this.menuItem10 = new System.Windows.Forms.MenuItem();
this.menuItem11 = new System.Windows.Forms.MenuItem();
this.menuItem13 = new System.Windows.Forms.MenuItem();
this.menuItem14 = new System.Windows.Forms.MenuItem();
this.menuItem15 = new System.Windows.Forms.MenuItem();
this.menuItem16 = new System.Windows.Forms.MenuItem();
this.menuItem12 = new System.Windows.Forms.MenuItem();
this.menuItem17 = new System.Windows.Forms.MenuItem();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton5 = new System.Windows.Forms.ToolBarButton();
this.SuspendLayout();
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem6,
this.menuItem11,
this.menuItem12,
this.menuItem17});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2,
this.menuItem4,
this.menuItem18,
this.menuItem5});
this.menuItem1.Text = "餐厅设施管理";
//
// menuItem2
//
this.menuItem2.Index = 0;
this.menuItem2.Text = "菜单管理";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// menuItem4
//
this.menuItem4.Index = 1;
this.menuItem4.Text = "-";
//
// menuItem18
//
this.menuItem18.Index = 2;
this.menuItem18.Text = "返回登陆";
this.menuItem18.Click += new System.EventHandler(this.menuItem18_Click);
//
// menuItem5
//
this.menuItem5.Index = 3;
this.menuItem5.Text = "退出程序";
this.menuItem5.Click += new System.EventHandler(this.menuItem5_Click);
//
// menuItem6
//
this.menuItem6.Index = 1;
this.menuItem6.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem7,
this.menuItem10});
this.menuItem6.Text = "餐厅事务管理";
//
// menuItem7
//
this.menuItem7.Index = 0;
this.menuItem7.Text = "预约管理";
this.menuItem7.Click += new System.EventHandler(this.menuItem7_Click);
//
// menuItem10
//
this.menuItem10.Index = 1;
this.menuItem10.Text = "查询帐单";
this.menuItem10.Click += new System.EventHandler(this.menuItem10_Click);
//
// menuItem11
//
this.menuItem11.Index = 2;
this.menuItem11.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem13,
this.menuItem14,
this.menuItem15,
this.menuItem16});
this.menuItem11.Text = "窗口";
//
// menuItem13
//
this.menuItem13.Index = 0;
this.menuItem13.Text = "层叠窗口";
this.menuItem13.Click += new System.EventHandler(this.menuItem13_Click);
//
// menuItem14
//
this.menuItem14.Index = 1;
this.menuItem14.Text = "垂直窗口";
this.menuItem14.Click += new System.EventHandler(this.menuItem14_Click);
//
// menuItem15
//
this.menuItem15.Index = 2;
this.menuItem15.Text = "水平窗口";
this.menuItem15.Click += new System.EventHandler(this.menuItem15_Click);
//
// menuItem16
//
this.menuItem16.Index = 3;
this.menuItem16.Text = "排列窗口";
this.menuItem16.Click += new System.EventHandler(this.menuItem16_Click);
//
// menuItem12
//
this.menuItem12.Index = 3;
this.menuItem12.Text = "帮助";
this.menuItem12.Click += new System.EventHandler(this.menuItem12_Click);
//
// menuItem17
//
this.menuItem17.Index = 4;
this.menuItem17.Text = "";
this.menuItem17.Click += new System.EventHandler(this.menuItem17_Click);
//
// imageList1
//
this.imageList1.ImageSize = new System.Drawing.Size(20, 20);
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// toolBar1
//
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButton1,
this.toolBarButton3,
this.toolBarButton4,
this.toolBarButton5});
this.toolBar1.DropDownArrows = true;
this.toolBar1.ImageList = this.imageList1;
this.toolBar1.Location = new System.Drawing.Point(0, 0);
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(1028, 32);
this.toolBar1.TabIndex = 1;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
//
// toolBarButton1
//
this.toolBarButton1.ImageIndex = 0;
this.toolBarButton1.ToolTipText = "菜单管理";
//
// toolBarButton3
//
this.toolBarButton3.ImageIndex = 1;
this.toolBarButton3.ToolTipText = "帐单";
//
// toolBarButton4
//
this.toolBarButton4.ImageIndex = 2;
this.toolBarButton4.ToolTipText = "退出";
//
// toolBarButton5
//
this.toolBarButton5.ImageIndex = 3;
this.toolBarButton5.ToolTipText = "帮助";
//
// frmmain
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.SystemColors.InactiveCaptionText;
this.ClientSize = new System.Drawing.Size(1028, 725);
this.Controls.Add(this.toolBar1);
this.IsMdiContainer = true;
this.Menu = this.mainMenu1;
this.Name = "frmmain";
this.Text = "餐饮管理";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Closing += new System.ComponentModel.CancelEventHandler(this.frmmain_Closing);
this.Load += new System.EventHandler(this.frmmain_Load);
this.ResumeLayout(false);
}
#endregion
private void menuItem3_Click(object sender, System.EventArgs e)
{
// frmTtype zz=new frmTtype();
// zz.Show();
}
private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)//工具栏
{
switch(this.toolBar1.Buttons.IndexOf(e.Button))
{
case 0:
{
frmcaidan zz=new frmcaidan();
zz.ShowDialog();
break;
}
case 1:
{
frmdayin zz=new frmdayin();
zz.ShowDialog();
break;
}
case 2:
{
this.Close();
break;
}
case 3:
{
Help.ShowHelp(this,System.Windows.Forms.Application.StartupPath+"\\help.chm");//帮助
break;
}
}
}
private void menuItem2_Click(object sender, System.EventArgs e)
{
frmcaidan zz=new frmcaidan();
zz.ShowDialog();
}
private void frmmain_Load(object sender, System.EventArgs e)
{
// frmcaidan zz=new frmcaidan();
// zz.MdiParent=this;
// zz.Show();
frmxianshi cc=new frmxianshi();
cc.MdiParent=this;
cc.Show();
}
private void menuItem5_Click(object sender, System.EventArgs e)
{
DialogResult tccy=new DialogResult();
tccy=MessageBox.Show("您确定要退出程序吗?","确认",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
if(tccy==DialogResult.Yes)
{
this.Close();
}
}
private void menuItem9_Click(object sender, System.EventArgs e)
{
frmxianshi cc=new frmxianshi();
cc.MdiParent=this;
cc.ShowDialog();
}
private void menuItem12_Click(object sender, System.EventArgs e)
{
Help.ShowHelp(this,System.Windows.Forms.Application.StartupPath+"\\help.chm");
}
private void menuItem8_Click(object sender, System.EventArgs e)
{
}
private void menuItem10_Click(object sender, System.EventArgs e)
{
frmdayin zz=new frmdayin();
zz.ShowDialog();
}
private void menuItem7_Click(object sender, System.EventArgs e)
{
frmyd1 zz=new frmyd1();
zz.ShowDialog();
}
private void menuItem17_Click(object sender, System.EventArgs e)
{
}
private void menuItem18_Click(object sender, System.EventArgs e)
{
DialogResult panduan=new DialogResult();
panduan=MessageBox.Show("您确定要返回登陆界面吗?","确认",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
if(panduan==DialogResult.Yes)
{
this.Hide();
dl.Show();
}
}
private void frmmain_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
// DialogResult panduan=new DialogResult();
// panduan=MessageBox.Show("您确定要关闭餐厅界面吗?","确认",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
// if(panduan==DialogResult.Yes)
// {
// Application.Exit();
// }
Application.Exit();
}
private void button1_Click(object sender, System.EventArgs e)
{
}
private void menuItem13_Click(object sender, System.EventArgs e)
{
this.LayoutMdi(MdiLayout.Cascade);
}
private void menuItem14_Click(object sender, System.EventArgs e)
{
this.LayoutMdi(MdiLayout.TileVertical);
}
private void menuItem15_Click(object sender, System.EventArgs e)
{
this.LayoutMdi(MdiLayout.TileHorizontal);
}
private void menuItem16_Click(object sender, System.EventArgs e)
{
this.LayoutMdi(MdiLayout.ArrangeIcons);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -