F#VS2019 Windows窗体 [英] F# VS2019 Windows Forms

查看:381
本文介绍了F#VS2019 Windows窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习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:

  1. 打开项目文件(在Visual Studio中双击该节点)
  2. Sdk更改为Microsoft.NET.Sdk.WindowsDesktop
  3. 确保您拥有此OutputType:<OutputType>WinExe</OutputType>
  4. 将以下属性添加到顶级PropertyGroup:<UseWindowsForms>true</UseWindowsForms>
  1. Open the project file (double-click on the node in Visual Studio)
  2. Change the Sdk to Microsoft.NET.Sdk.WindowsDesktop
  3. Ensure you have this OutputType: <OutputType>WinExe</OutputType>
  4. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆