F#VS2019 Windows窗体 [英] F# VS2019 Windows Forms
问题描述
我正在学习F#,我只是想构建Animate摆程序. 这是代码: https://rosettacode.org/wiki/Animate_a_pendulum#F.23
I'm learning F# and I'm just trying to build Animate a pendulum program. Here's the code: https://rosettacode.org/wiki/Animate_a_pendulum#F.23
据我了解,VS 2019不支持F#中的WinForms(也许我错了),所以我有错误消息,试图复制/粘贴该代码:
As far as I understand, VS 2019 doesn't support WinForms in F# (maybe, I'm wrong), so I have error messages, trying to copy/paste that code:
我该怎么办?
非常感谢!
What should I do?
Thanks a lot !
推荐答案
如果要在.NET Core上使用Winforms,则需要在项目中执行以下操作:
If you're looking to use Winforms on .NET core, you'll need to do the following in your project:
- 打开项目文件(在Visual Studio中双击该节点)
- 将
Sdk
更改为Microsoft.NET.Sdk.WindowsDesktop
- 确保您拥有此
OutputType
:<OutputType>WinExe</OutputType>
- 将以下属性添加到顶级
PropertyGroup
:<UseWindowsForms>true</UseWindowsForms>
- Open the project file (double-click on the node in Visual Studio)
- Change the
Sdk
toMicrosoft.NET.Sdk.WindowsDesktop
- Ensure you have this
OutputType
:<OutputType>WinExe</OutputType>
- Add the following property to the top-level
PropertyGroup
:<UseWindowsForms>true</UseWindowsForms>
没有视觉设计师可以使用,但是您应该有权使用API.
There won't be a visual designer to use, but you should have access to the APIs.
这篇关于F#VS2019 Windows窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!