Winform学生信息管理系统各子窗体剖析(3)

2019-12-30 12:41:32王旭


<span style="font-size:18px;"><span style="font-size:18px;">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 WindowsForms 
{ 
  public partial class Form2 : Form 
  { 
    public Form2(string s) 
    { 
      InitializeComponent(); 
      tssl_name.Text = s;//将登陆窗口textBox1输入的信息传递给状态栏Text属性 
    } 
 
    private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) 
    { 
      Application.Exit();//单击主菜单中的退出我们退出整个程序 
    } 
 
    private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) 
    { 
 
    } 
 
    private void toolStripButton1_Click(object sender, EventArgs e) 
    { 
      Children qq = new Children();//创建一个子窗体的实例 
      qq.MdiParent = this;//要求子窗体的父窗体是MDI窗体 
      qq.Show(); 
    } 
 
    private void 学生信息ToolStripMenuItem_Click(object sender, EventArgs e) 
    { 
      Children1 c1 = new Children1(); 
      c1.MdiParent = this; 
      c1.Show(); 
    } 
 
    private void 用户信息ToolStripMenuItem_Click(object sender, EventArgs e) 
    { 
      Children2 c2 = new Children2(); 
      c2.MdiParent = this; 
      c2.Show(); 
    } 
 
    private void 用户密码修改ToolStripMenuItem_Click(object sender, EventArgs e) 
    { 
      Children3 c3 = new Children3(); 
      c3.MdiParent = this; 
      c3.Show(); 
    } 
  } 
}</span> 

完整的子窗体Children1(学生信息添加窗体)的代码为:


<span style="font-size:18px;">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 WindowsForms 
{ 
  public partial class Children1 : Form 
  { 
    public Children1() 
    { 
      InitializeComponent(); 
    } 
 
    private void button2_Click(object sender, EventArgs e) 
    { 
      Close(); 
    } 
  } 
}</span> 

完整的子窗体Children2(用户信息添加窗体)的代码为:


<span style="font-size:18px;">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 WindowsForms 
{ 
  public partial class Children2 : Form 
  { 
    public Children2() 
    { 
      InitializeComponent(); 
    } 
 
    private void button2_Click(object sender, EventArgs e) 
    { 
      Close(); 
    } 
 
    private void s(object sender, EventArgs e) 
    { 
    } 
  } 
}</span>