【WPF】如何引用System.Windows.Forms;
修改项目的csproj文件
<PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net6.0-windows</TargetFramework> <Nullable>enable</Nullable> <UseWPF>true</UseWPF> <UseWindowsForms>true</UseWindowsForms> </PropertyGroup>
添加<UseWindowsForms>true</UseWindowsForms>