简体   繁体   English

从C#中的类库访问Windows应用程序表单

[英]Accessing windows application forms from class library in C#

I have a solution in C# with 2 project of 2 different types: windows app and class library. 我在C#中有2个不同类型的2个项目的解决方案:Windows应用程序和类库。 They all share the same namespace but I can't access forms in windows app although I add reference to System.Windows.Form in CL project. 它们都共享相同的名称空间,但是尽管我在CL项目中添加了对System.Windows.Form的引用,但我无法在Windows应用程序中访问表单。 Help me, please! 请帮帮我!

如果需要访问WinApp中的表单,则需要将该WinApp添加为对类库的引用。

您无法从库访问Windows窗体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM