Is there a way to convert my Console Application into a Windows Forms Application in C#?

10,419

Solution 1

You need to add a reference to the WinForms assembly

  • Right click on the solution and select "Add Reference"
  • Select System.Windows.Forms and hit OK

You may need to do the same for System.Data as well depending on your project setup

Solution 2

Make sure you add the System.Windows.Forms assembly in your references for the project. In the solution explorer, right click on 'References' and then under the .NET tab find the System.Windows.Forms assembly and add it.

Solution 3

You need to add a reference to System.Windows.Forms. Right-click your project and choose Add Reference.

On the .NET tab choose the the previously mentioned reference.

Share:
10,419
Slateboard
Author by

Slateboard

Looking to be a good Programmer.

Updated on June 07, 2022

Comments

  • Slateboard
    Slateboard almost 2 years

    I created a console application, but I want to turn it into a windows forms application.

    I found This and it appeared to be what I needed, but I got an error message when I tried to use using System.Windows.Forms;

    This is the error message I got:

    Error 1 The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)

    Is there another step, or is it somehow different in VS 2008?