C# winform程序,初始界面为form1窗口。program.cs中MAIN函数调用form1窗口的代码如下: public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new Form1(args));
}
form1窗口的构造函数如下: public Form1(string[] args)
{
initializeComponent();
......
}以上程序运行正常。我现在想把初始界面设为frmMain窗口,从frmMain窗口中再调用form1窗口。调用代码如下: private void toolStripMenuItem39_Click(object sender, EventArgs e)
{
new DocumentProcessing.Form1(new string[]{"1","2","3"}).ShowDialog();
}虽然可以运行,但是会先弹出一个错误提示框,显示“IO Error”,然后调出from1窗口。请问有什么好的调用办法吗?
顺便说一下,以下调用方法是不可行的。 private void toolStripMenuItem39_Click(object sender, EventArgs e)
{
new DocumentProcessing.Form1(string[] args).ShowDialog();
}
{
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new Form1(args));
}
form1窗口的构造函数如下: public Form1(string[] args)
{
initializeComponent();
......
}以上程序运行正常。我现在想把初始界面设为frmMain窗口,从frmMain窗口中再调用form1窗口。调用代码如下: private void toolStripMenuItem39_Click(object sender, EventArgs e)
{
new DocumentProcessing.Form1(new string[]{"1","2","3"}).ShowDialog();
}虽然可以运行,但是会先弹出一个错误提示框,显示“IO Error”,然后调出from1窗口。请问有什么好的调用办法吗?
顺便说一下,以下调用方法是不可行的。 private void toolStripMenuItem39_Click(object sender, EventArgs e)
{
new DocumentProcessing.Form1(string[] args).ShowDialog();
}
这样的打开一个form应该没问题吧
private void toolStripMenuItem39_Click(object sender, EventArgs e) { new DocumentProcessing.Form1(args).ShowDialog(); }
private void toolStripMenuItem39_Click(object sender, EventArgs e)
{
new DocumentProcessing.Form1(aaa).ShowDialog();
}