所以,我有我的類文件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