本帖最后由 syeanwoo 于 2011-10-21 19:49 编辑
杜斌 发表于 2011-10-21 18:21 
先加入一个Windows Form,然后再你需要的时候调用
Form.Shw();
我先建立了一个Class,再插入了一个Windows Form类的Form1,里面编写了调用窗体的命令ShowForm(),里面用了Form1.Show(),但是提示错误:System.Windows.Forms.Control.Show()缺乏引用,需要添加。可是我已经添加了using System.Windows.Forms.不知何故。 - using System.Windows.Forms;
- ......
- public void ShowFormMain()
- {
- MyFirstProject.frmMain.Show();
- }
Error 1 An object reference is required for the non-static field, method, or property 'System.Windows.Forms.Control.Show()'
|