所以,我有我的类文件C#中:MessageBox.Show错误 - 方法,但使用像一个类型
using System.Windows.Forms;
开始的声明,但是当我尝试发出声明
MessageBox.Show("Pow");
我收到错误
Error 2 'System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window, string)' is a 'method' but is used like a 'type'
完整代码:
using System.Windows.Forms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Contacts
{
class AnotherClass
{
MessageBox.Show("Pow");
}
}
我似乎无法找到任何理由。另一个奇怪的是,当我键入MessageBox时,Intellisense发现它,但放置我的(。)后,我没有收到该类的方法选项的典型菜单,如“显示”。
有什么想法?
这是什么类型的项目?控制台,图书馆,WinForms,其他? – DevSolo 2010-06-22 14:35:21