123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsDemo1
- {
- public partial class Form3 : Form
- {
- public Form3()
- {
- InitializeComponent();
- }
- private void Form3_Click(object sender, EventArgs e)
- {
- MessageBox.Show("你好");
- }
- private void Form3_FormClosing(object sender, FormClosingEventArgs e)
- {
- DialogResult dr = MessageBox.Show("是否关闭窗体","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
- if (dr == DialogResult.Yes)
- {
- e.Cancel = false;
- }
- else {
- e.Cancel = true;
- }
- }
- private void Form3_Load(object sender, EventArgs e)
- {
- Form2 f2 = new Form2();
- f2.Show();
- f2.MdiParent = this;
- Form1 f1 = new Form1();
- f1.Show();
- f1.MdiParent = this;
- Form4 f4 = new Form4();
- f4.Show();
- f4.MdiParent = this;
- }
- private void 水平平铺ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- LayoutMdi(MdiLayout.TileHorizontal);
- }
- private void 垂直平铺ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- LayoutMdi(MdiLayout.TileVertical);
- }
- }
- }
|