
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1())
}
把中间的 Form1 改成你要d出的窗口名就可以了
如果你使用的是 2005
则在项目中有一个 Program.cs 这个文件
能看到其中代码是
static void Main()
{
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(false)
Application.Run(new Form1())
}
新建一个窗体Form1,在设置Form1的属性IsMdiContainer 的属性为true,在Form1上面放置一个button按钮,然后在新建一个Form2,在Button单击事件里面写上代码:
private void button1_Click_1(object sender, EventArgs e)
{
Form2 f2 = new Form2()
f2.MdiParent = this
f2.Show()
}
你看你要的是这种效果吗
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)