1.选择.NETCore WinFormApp启用窗体设计器
2.点击项目名称,修改项目文件属性
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project>
3.修改program.cs里Main方法,如下:
#if netcoreapp3_0
Application.SetHighDpiMode(HighDpiMode.SystemAware);
#endif
4.如果控件不出来
视图---工具栏