久久精品综合-欧美精品久久久久久-www一区二区-韩国三级中文字幕hd久久精品-国产一区二区三区在线-日韩免费视频

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

終于搞定c#中對mdi的設置,代碼見內(parent局部)

[摘要]花了我一上午的時間,找來找去找不到答案,又是急性子,只好自己動手了,見笑,也請大家多提意見,謝了。parent.cs------------------------------------------------------------using System;using System.Drawi...
花了我一上午的時間,找來找去找不到答案,又是急性子,只好自己動手了,見笑,也請大家多提意見,謝了。

parent.cs
------------------------------------------------------------
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace testagain
{
/// <summary>
/// Summary description for parent.
/// </summary>
public class parent : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem m_FileMenu;
private System.Windows.Forms.MenuItem m_OpenFile;
private System.Windows.Forms.MenuItem m_Close;
private System.Windows.Forms.MdiClient mdiClient1;
private System.Windows.Forms.MenuItem menuItem1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public parent()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
testform f_test = new testform(this);
f_test.Show();
//
// TODO: Add any constructor code after InitializeComponent call
//
}

public static void Main()
{
Application.Run(new parent());
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.m_FileMenu = new System.Windows.Forms.MenuItem();
this.m_OpenFile = new System.Windows.Forms.MenuItem();
this.m_Close = new System.Windows.Forms.MenuItem();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.mdiClient1 = new System.Windows.Forms.MdiClient();
this.SuspendLayout();
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.m_FileMenu,
this.menuItem1});
//
// m_FileMenu
//
this.m_FileMenu.Index = 0;
this.m_FileMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
 this.m_OpenFile,
 this.m_Close});
this.m_FileMenu.Text = "文件(&F)";
//
// m_OpenFile
//
this.m_OpenFile.Index = 0;
this.m_OpenFile.Shortcut = System.Windows.Forms.Shortcut.CtrlO;
this.m_OpenFile.Text = "Dns探測";
this.m_OpenFile.Click += new System.EventHandler(this.m_OpenFile_Click);
//
// m_Close
//
this.m_Close.Index = 1;
this.m_Close.Shortcut = System.Windows.Forms.Shortcut.CtrlX;
this.m_Close.Text = "關閉";
this.m_Close.Click += new System.EventHandler(this.m_Close_Click);
//
// menuItem1
//
this.menuItem1.Index = 1;
this.menuItem1.Text = "關于...(&A)";
this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
//
// mdiClient1
//
this.mdiClient1.Dock = System.Windows.Forms.DockStyle.Fill;
this.mdiClient1.Name = "mdiClient1";
this.mdiClient1.TabIndex = 0;
//
// parent
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(536, 309);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.mdiClient1});
this.IsMdiContainer = true;
this.Menu = this.mainMenu1;
this.Name = "parent";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "MDI窗體操作演示_父窗體";
this.ResumeLayout(false);

}
#endregion

private void menuItem1_Click(object sender, System.EventArgs e)
{
Form f_activeform = this.ActiveMdiChild;
if (f_activeform != null)
{
if (f_activeform.Name != null && f_activeform.Name != "parent")
{
f_activeform.Close();
}
}
child child_form = new child(this);

child_form.Show();

}

private void m_Close_Click(object sender, System.EventArgs e)
{
this.Close();
}

private void m_OpenFile_Click(object sender, System.EventArgs e)
{
Form f_activeform = this.ActiveMdiChild;

if (f_activeform != null)
{
if (f_activeform.Name != null && f_activeform.Name != "parent")
{
f_activeform.Close();
}
}
testform f_test = new testform(this);
f_test.Show();
}
}
}
 


主站蜘蛛池模板: 亚洲国产日韩欧美在线a乱码 | 日韩中文字幕在线亚洲一区 | 小泽玛利亚久久一区二区三区 | 中文字幕在线视频在线看 | 欧美午夜视频在线 | 婷婷综合久久中文字幕 | 午夜影视体验区 | 一区二区网站在线观看 | 青青草原社区 | 日本道综合一本久久久88 | 四虎在线免费观看视频 | 日韩有码第一页 | 人碰人操 | 视频一区二区精品的福利 | 亚洲国产三级在线观看 | 在线观看亚洲精品专区 | 亚洲va久久久噜噜噜久久狠狠 | 日韩亚洲欧美一区二区三区 | 青青青国产在线 | 一二三四免费观看在线8 | 四虎影院一区二区 | 日本乱人伦片中文字幕三区 | 夜夜操伊人 | 青青草影院在线观看 | 网站在线观看 | 青苹果a4yy私人毛片 | 天堂网www在线资源链接 | 一二三四免费观看在线影视大全 | 伊人久久大香线蕉资源 | 四虎永久在线精品 | 特黄aaaaaaaaa及毛片 | 青草九九| 又粗又大又长又爽免费视频 | 亚洲成a人片毛片在线 | 婷婷欧美 | 日韩激情视频在线观看 | 青青青国产在线观看 | 欧美资源在线 | 亚洲a级片在线观看 | 欧美一级片网站 | 伊人色影院 |