0

I've seen this problem on google a few times and I've seen people solve it, but whatever solution I saw and tried didn't work. I saw things like

putting the "public partial class Form1 : Form" first, or pressing F7, or using the View tab to-go-to designer and etc, none has worked. I did manage to look at another file code Form1 Designer, but it was a code as well, different than the form's code but still code, and when I run it it shows a blank page meaning that code does work, I just can't visualize it. Can anyone help me, please?

Appreciate all the help :)

1Mangomaster1
  • 346
  • 1
  • 6
  • 16
  • Did you create the form using the designer? For the designer to work, the [FormName].Designer.cs file has to be in a format that the designer expects. If it's not, you will usually get a rather verbose (and somewhat intimidating) error when you try to open it. Can you open the designer on a form in an existing project? – Flydog57 Feb 18 '20 at 22:21
  • I did not create any of them, once I created the project it created it all automatically and put it on the code instead of the design view, and I don't know how to go to the design view – 1Mangomaster1 Feb 18 '20 at 22:24
  • Are you targeting .net core? Or .net framework? – gnud Feb 18 '20 at 22:33
  • I don't even know, how can I check? I do have framework as a dependency so I assume framework? But inside the framwork it says something about .net core so I don't know I am new to Visual Studio.. sorry for these questions – 1Mangomaster1 Feb 18 '20 at 22:35
  • 1
    Open Visual Studio. Choose File-> New Project. Use the Search box to find "Windows Forms App (.NET Framework) C#". Choose a Name, a location and a Framework version and press OK. After a few moments, VS should open an empty form named "Form1" in the designer. If you don't have the "Toolbox" open, open it (View -> Toolbox). If the form is selected in the designer you should have a toolbox full of controls available. Double-click on "Button", and a button should show up in the view. Double-click on the button and you should end up in your button click handler in Form1.cs. – Flydog57 Feb 18 '20 at 23:03

1 Answers1

1

To check the target framework of your project, you can follow Project -> Properties... Application. And then you can see the target in the page.

enter image description here

If the target is .Net Framework, you can follow the steps provided by Flydog57.

If it is a Windows Forms App(.Net Core), there is no Designer by default.

The .NET Core Windows Forms designer is available with the Visual Studio 16.5 Preview 1. So you can try to update Visual Studio to Visual Studio 16.5 Preview 1 or a later version.

For more details, you can refer to this blog.

Updates to .NET Core Windows Forms designer in Visual Studio 16.5 Preview 1

大陸北方網友
  • 3,696
  • 3
  • 12
  • 37