我需要在类库项目中添加一个引用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>();
.....
}
1条答案
按热度按时间cygmwpex1#
我创建Windows窗体项目,将其更改为项目属性中的类库,删除Form1和Program.cs,它就可以工作了。