zoukankan      html  css  js  c++  java
  • winform 新建窗体1

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace MDI窗体
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void 销售模块ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                bool has = false;
                Form2 f2 = new Form2();
    
                foreach (Form f in panel1.Controls)
                {
                    if (f.Name == f2.Name)
                    {
                        has = true;
                        f.Show();
                        f2.Close();
                    }
                }
                if (has)
                {
                    foreach (Form f in panel1.Controls)
                    {
                        if (f.Name != f2.Name)
                        {
                            f.Hide();
                        }
                    }
                }
                else
                {
                    f2.WindowState = FormWindowState.Maximized;
                    f2.MdiParent = this;
                    f2.Parent = panel1;
                    f2.Show();
                }
            }
    
            private void 仓库模块ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                bool has = false;
                Form3 f3 = new Form3();
    
                foreach (Form f in panel1.Controls)
                {
                    if (f.Name == f3.Name)
                    {
                        has = true;
                        f.Show();
                        f3.Close();
                    }
                }
                if (has)
                {
                    foreach (Form f in panel1.Controls)
                    {
                        if (f.Name != f3.Name)
                        {
                            f.Hide();
                        }
                    }
                }
                else
                {
                    f3.WindowState = FormWindowState.Maximized;
                    f3.MdiParent = this;
                    f3.Parent = panel1;
                    f3.Show();
                }
            }
    
    
        }
    }
  • 相关阅读:
    无题
    赌对了
    赌:
    这次是真的再见了,oi退役回忆录
    线段树(lazy标记)
    《挑战》2.1 POJ POJ 1979 Red and Black (简单的DFS)
    《挑战》2.1 POJ 2386 Lake Counting (简单的dfs)
    TC安装全系列教程
    ProblemC 剪花布条(KMP基础)
    多校+CF简单题
  • 原文地址:https://www.cnblogs.com/zhangdemin/p/5640742.html
Copyright © 2011-2022 走看看