Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
多个c#windows窗体应用程序_C# - Fatal编程技术网

多个c#windows窗体应用程序

多个c#windows窗体应用程序,c#,C#,我有两个表单,主表单和一个名为FrmSteg的表单。我在主窗体上添加了一个按钮,并在按钮的单击事件中输入了下面的代码。但是我得到了一个错误“只能将赋值、调用、递增、递减和新对象表达式用作语句” 试试这个: newForm.Show(); this.Hide(); 您忘记了方法调用后面的(): newForm.Show(); this.Hide(); 如果新表单应该用作对话框类型,请使用ShowDialogue(newForm) 这将“锁定”主窗体,直到新窗体关闭 newForm.Show()

我有两个表单,主表单和一个名为FrmSteg的表单。我在主窗体上添加了一个按钮,并在按钮的单击事件中输入了下面的代码。但是我得到了一个错误“只能将赋值、调用、递增、递减和新对象表达式用作语句”

试试这个:

newForm.Show();
this.Hide();
您忘记了方法调用后面的
()

newForm.Show();
this.Hide();

如果新表单应该用作对话框类型,请使用
ShowDialogue(newForm)
这将“锁定”主窗体,直到新窗体关闭

newForm.Show();
this.Hide();