为什么这样的Windows Control Labrary 不能顺利生成?

yanghant74 2004-10-30 09:45:49
有两个工程:(使用相同的命名空间)
一个是Windows 应用程序工程,在其定义了一个窗体类Form1.
另一个是Windows Control Labrary工程,定义了一个窗体类ConnForm.
在窗体类ConnForm中有一个Form1类型的私有字段f1。
在生成Windows Control Labrary工程时总提示找不到类型或命名空间Form1。
请高手点拨。
...全文
67 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
jkflyfox 2004-10-30
  • 打赏
  • 举报
回复
怎么控件库里反而要使用要用到这个控件库的窗体阿
这个好像把关系搞错了阿
应该是应用程序引用控件库阿。
saucer 2004-10-30
  • 打赏
  • 举报
回复
一般来说,Windows Control Labrary工程应该是独立的,不应该对应用程序有依赖

在Windows Control Labrary工程中定义一个新的窗体类MyForm,把ConnForm需要使用的Form1中的东西搬进去,把ConnForm中的私有字段f1变成是MyForm的

应用程序工程中,添加对Windows Control Labrary工程加引用,然后,把你的窗体类Form1的基类改成MyForm。。。
paul8765 2004-10-30
  • 打赏
  • 举报
回复
没添加Form1的dll引用吧。
yanghant 2004-10-30
  • 打赏
  • 举报
回复
谢谢思归,这是一个软件的两个部分,准备分别由两个人完成。
请高手们指教(我没看懂)
yanghant 2004-10-30
  • 打赏
  • 举报
回复
up
saucer 2004-10-30
  • 打赏
  • 举报
回复
what is the relationship between those projects? you need to add project dependency, also note, you need to specify a namespace, if they are different

but if your control library project needs that Form1 class, consider to move that class into the control library project, since normally, it is a bad idea to add a project dependency on a 应用程序工程

110,561

社区成员

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

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

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