子窗体的名称可以在生成的时候 自己指定的 Form ff = new Form(); ff.Text = "ff"; ff.Show();
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 WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Form ff = new Form(); ff.Text = "ff"; ff.Show(); TabPage tab = new TabPage("ff"); //选项卡文本 this.tabControl1.TabPages.Add(tab); tabControl1.SelectTab(Convert.ToInt16(tabControl1.TabPages.Count - 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 WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Form ff = new Form(); ff.Text = "ff"; ff.MdiParent=this; ff.Show();
ff.Text = "ff";
ff.Show();
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Form ff = new Form();
ff.Text = "ff";
ff.Show();
TabPage tab = new TabPage("ff"); //选项卡文本 this.tabControl1.TabPages.Add(tab); tabControl1.SelectTab(Convert.ToInt16(tabControl1.TabPages.Count - 1));
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Form ff = new Form();
ff.Text = "ff";
ff.MdiParent=this;
ff.Show();
}
}
}