库类

justin_zeng1986 2011-01-18 01:21:20
我新建了一个库类,库类中引用鼠标事件: public event System.MouseEventHandler OnMouseActivity;但是提示我没有定义,但是在库类中也不能加入using System.Windows.Forms;命名空间,请问如何解决?
...全文
96 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
hztltgg 2011-01-18
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 justin_zeng1986 的回复:]
#3楼:
System.Windows.Forms这个命名空间在类库中不能使用!
[/Quote]

从来就没有限制过某个类库不能使用另外一个类库的问题,所有的类库都是平等的。
jeremyyang824 2011-01-18
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 justin_zeng1986 的回复:]
#3楼:
System.Windows.Forms这个命名空间在类库中不能使用!
[/Quote]

先添加了System.Windows.Forms.dll引用后你把类名打错了
是public event System.Windows.Forms.MouseEventHandler OnMouseActivity;
justin_zeng1986 2011-01-18
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 sudianbo 的回复:]
能加入using System.Windows.Forms;
前提是必须加入了对System.Windows.Forms程序集的引用
[/Quote]
System.Windows.Forms这个命名空间在类库中不能使用!
justin_zeng1986 2011-01-18
  • 打赏
  • 举报
回复
#3楼:
System.Windows.Forms这个命名空间在类库中不能使用!
_三皮_ 2011-01-18
  • 打赏
  • 举报
回复
能加入using System.Windows.Forms;
前提是必须加入了对System.Windows.Forms程序集的引用
jeremyyang824 2011-01-18
  • 打赏
  • 举报
回复
是System.Windows.Forms.MouseEventHandler 不是 System.MouseEventHandler 。。。。
justin_zeng1986 2011-01-18
  • 打赏
  • 举报
回复
恩!是类库!打错了!
andy1020tc 2011-01-18
  • 打赏
  • 举报
回复
类库吧?

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧