繁体   English   中英

为什么我在 Microsoft Visual Studio 2019 中看不到设计器视图?

[英]Why don't I see the Designer View in Microsoft Visual Studio 2019?

所以我一直在尝试使用设计器创建一个 Windows 窗体(将元素拖放到窗口,移动它们等等),但不幸的是,我只能看到代码。

我添加了一个新的 Windows 窗体 - PhoneBookDisplay.cs。 当我双击它时,我看到以下代码:

using System.Windows.Forms;

namespace EvenTool
{
    public partial class PhoneBookDisplay : Form
    {
        public PhoneBookDisplay()
        {
            InitializeComponent();
        }
    }
}

当我用鼠标右键按下它时,有视图设计器 (Shift+F7) 选项,我按下但没有任何反应,系统提示我使用与上面相同的代码。

还有带有以下代码的 PhoneBookDisplay.Designer.cs 文件:

namespace EvenTool
{
    partial class PhoneBookDisplay
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(800, 450);
            this.Text = "PhoneBookDisplay";
        }

        #endregion
    }
}

当我调用 View Designer 选项时,我被重定向到第一个示例中的代码。 所以我基本上无法使用工具箱进行设计,我可以在其中拖放按钮等元素。

我是 Visual Studio 的新手,所以我不确定如何继续。 我试过在谷歌上搜索它,但大多数情况下都包含一条错误消息,而我只是显示了一个代码,无论我按什么。

提供的代码看起来是正确的。 但是,当您在 .Net Core 中使用 Windows 表单时,您无法打开设计器。 这是当前版本的 Visual Studio 中的已知限制。 这里

你可以使用 .Net 框架

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM