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

📄 form1.cs

📁 全面介绍了MDI使用 全面介绍了MDI使用
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //dlg1.FormBorderStyle = FormBorderStyle.None;
            dlg1.Show();
            dlg1.Top = 0;
            dlg1.Left = 0;
            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            dlg1.Show();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            dlg1.Top = 0;
            dlg1.Left = 0;
            dlg1.Visible = false;
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {

    
        }

        private void Form1_Load(object sender, EventArgs e)
        {
        
            dlg1 = new dlg_1();
            
            dlg1.MdiParent = this;
            dlg1.FormBorderStyle = FormBorderStyle.None;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Form form1 = new Form();
            Button button1 = new Button();
            Button button2 = new Button();
            button1.Text = "OK";
            button1.Location = new Point(10, 10);
            button2.Text = "Cancel";
            button2.Location  = new Point(button1.Left, button1.Height + button1.Top + 10); 
            form1.Text = "My Dialog Box";
            form1.HelpButton = true;
            form1.FormBorderStyle = FormBorderStyle.FixedDialog;
            form1.MaximizeBox = false;
            form1.MinimizeBox = false;
            form1.AcceptButton = button1;
            form1.CancelButton = button2;
            form1.StartPosition = FormStartPosition.CenterScreen;
            form1.Controls.Add(button1);
            form1.Controls.Add(button2);
            form1.ShowDialog();

        }
    }
}

⌨️ 快捷键说明

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