读书人

请教dll文件为什么不能MessageBox.S

发布时间: 2012-12-14 10:33:08 作者: rapoo

请问,dll文件为什么不能MessageBox.Show()
创建一个dll文件,如下:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
namespace aaaaa
{
public class Person
{
public void Say()
{
MessageBox.Show("dfgfg");
}
}
}


不能使用MessageBox,为什么?
添加using System.Windows.Forms;也不能添加,为什么?
[最优解释]
先要引用Systen.Windows.Forms库。
[其他解释]
先在工程中引用 System.Windows.Forms.dll

读书人网 >C#

热点推荐