显示多种形式C#应用程序启动时 [英] Display multiple forms when C# application starts
本文介绍了显示多种形式C#应用程序启动时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的C#应用程序3种形式 - Form1中,窗体2和Form3。目前,当我的应用程序启动时,它加载了Form1上。我想这三种形式在应用程序启动时打开
I have 3 forms in my C# application -- Form1, Form2 and Form3. Currently when my application starts it loads up Form1. I want all three forms to open on application startup.
我试着在的Program.cs
操作:
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(new Form2());
}
但窗体2只Form1中关闭后显示出来。
but Form2 only shows up after Form1 is closed.
我怎样才能让所有3种形式,一旦同时出现在应用程序启动?
How can I make all 3 forms show up simultaneously as soon as the application starts?
推荐答案
启动其他形式从 Form.Load
Form1中
。
private void Form1_Load(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.Show();
}
这篇关于显示多种形式C#应用程序启动时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文