c# - Visual Studio 不再打开 Winforms 的图形编辑器

标签 c# visual-studio winforms

我正在构建非常小的 15 分钟应用程序,这些应用程序可以帮助我和我的同事处理简单的日常业务工作。

为此,我经常使用 WinForm,因为只需制作一个带有 2 个文本框和一个提交按钮的窗口,它的速度就太快了。

不幸的是,最近我想我点击了一个按钮,图形编辑器将不再打开。我将始终处于文本编辑器 View 中。

在网上我找不到任何关于如何打开这个该死的设计器的信息。我希望你们中有人知道答案。

问题: 这打开: enter image description here

应该是: enter image description here

最佳答案

如果您使用的是 Visual Studio 2019,您可能使用 .Net Core 3.0 创建了 Windows 窗体:

enter image description here

如果您的目标是 .NET Core,Visual Studio 2019 还没有适用于 WinForms 的设计器。 .NET Framework 版本应该适合您的情况。如果由于某种原因您的应用程序需要 .NET Core,您可以使用 WinForms Designer for Visual Studio 2019 的预览版,可在此处获取:https://devblogs.microsoft.com/dotnet/introducing-net-core-windows-forms-designer-preview-1/

2019 年 12 月 10 日更新: 如果您运行的是 Visual Studio 2019 16.5 Preview 1,则不再需要 VSIX 即可让设计人员在 .NET Core 上使用 WinForms。

来自.NET Blog :

To use the designer:

  • You must be using Visual Studio 16.5 Preview 1 or a later version.
  • You need to enable the designer in Visual Studio. Go to Tools > Options > Environment > Preview Features and select the Use the preview Windows Forms designer for .NET Core apps option.

关于c# - Visual Studio 不再打开 Winforms 的图形编辑器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58482401/

相关文章:

c# - 使用 Windows 窗体更新 mysql 数据库总是给出奇怪的错误消息

c# - 使用 "using"关键字时出现问题

c# - 如何从 IEnumerable 创建 List<T>?

c# - 在 c# 中,当从函数返回字符串时,内存是否被释放?

c# - 在 .net 中智能部署 dll

.net - Cassini (VS WebDev) 在不同线程上执行 BeginRequest 和 EndRequest

c# - VS2017 命令行构建(缺少 "%VS150COMNTOOLS%VSVars32.bat")

visual-studio - 在 Visual Studio 2019 中折叠所有内部大括号

c# - 通过部分匹配名称来查找多个控件

c# - 将 DataBinder.Eval 与包含句点的索引器一起使用