Avenix
Avenix

Reputation: 37

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

so I've been trying to create a Windows Form using the Designer (dragging and dropping the elements to the window, moving them and so on) but unfortunately, I can only see the code.

I've added a new Windows Form - PhoneBookDisplay.cs. When I double press it, I see this code:

using System.Windows.Forms;

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

When I press it with the right mouse button, there is the View Designer (Shift+F7) option, which I press but nothing happens, I am prompted with the same code as above.

There is also PhoneBookDisplay.Designer.cs file with this code:

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
    }
}

When I invoke the View Designer option, I am redirected to the code from the first example. So I am basically unable to Designer with the Toolbox where I could drag and drop the elements such as buttons etc.

I am new to the Visual Studio so I am not sure how to proceed. I've tried googling it but most cases involved an error message while I am simply shown a code, whatever I press.

Upvotes: 0

Views: 1234

Answers (1)

StefanG
StefanG

Reputation: 1264

The provided code looks correct. But when you are using Windows forms with .Net Core you can't open the designer. This is a known limitation in the current version of Visual Studio. See here:

You could use .Net Framework

Upvotes: 1

Related Questions