我正在处理一个使用System.Windows.Form创建图形用户界面的C#项目,我在VS项目中有两个表单( MainForm和InitialPrompt)。我以前从来没有用过表单,谷歌也帮不了我多少忙。
预期操作:
InitialPrompt负载
在InitialPrompt上单击按钮
加载MainForm
但是,因为MainForm是首先创建的,所以有一些属性/方法允许它首先加载,而InitialPrompt根本不加载。如何将InitialPrompt作为主要窗体和MainForm作为次要窗体?
提前谢谢。
发布于 2009-12-09 06:00:10
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}您可以将上面的代码更改为
Application.Run(new Form2()); // or whatever the name of the second form is.它位于您的Program.cs文件中。
https://stackoverflow.com/questions/1870123
复制相似问题