对.net7.0类库项目中System.Windows.Forms的引用

omqzjyyz  于 12个月前  发布在  .NET
关注(0)|答案(1)|浏览(240)

我需要在类库项目中添加一个引用System.Windows.Forms,该项目是用.net7.0编写的,将在NuGet中分发给我的年轻学生。如何做到这一点?我想添加到项目中的类:

public class DebugApp
{
   Form form;
   TextBox textBox = new TextBox();
   Button button = new Button();
   Label label = new Label();
   Panel panel = new Panel();
   List<string> data = new List<string>();
   .....
}
cygmwpex

cygmwpex1#

我创建Windows窗体项目,将其更改为项目属性中的类库,删除Form1和Program.cs,它就可以工作了。

相关问题