using System;
using System.Drawing;
using System.Windows.Forms;namespace _01_04
{
    public class Form_01_04 :System.Windows.Forms.Form
    {
        public Form_01_04()
        {
            Height = 200;
            Width = 500;
            Text = "My first Windows Form!";
        }
    }    public class Class_01_04
    {
        public static void Main(String[] args)
        {
            Form form=new Form_05_04();
            Application.Run(form);        
        }
    }
}
错误 1 命名空间“System”中不存在类型或命名空间名称“Drawing”(是缺少程序集引用吗?) D:\Program Files\MyC\ConsoleApplication4\ConsoleApplication4\Program.cs 2 14 ConsoleApplication4
错误 2 命名空间“System”中不存在类型或命名空间名称“Windows”(是缺少程序集引用吗?) D:\Program Files\MyC\ConsoleApplication4\ConsoleApplication4\Program.cs 3 14 ConsoleApplication4
错误 3 命名空间“System”中不存在类型或命名空间名称“Windows”(是缺少程序集引用吗?) D:\Program Files\MyC\ConsoleApplication4\ConsoleApplication4\Program.cs 7 37 ConsoleApplication4

解决方案 »

  1.   

    using System.Drawing;
    using System.Windows.Forms;
    用在winform里面的啊
      

  2.   

    是不是要把using 改掉?
    怎么改?
      

  3.   

    在引用中添加对这两个dll的引用
      

  4.   

    using System;
    using System.Drawing;
    using System.Windows.Forms;namespace _01_04
    {
        public class Form_01_04 :System.Windows.Forms.Form
        {
            public Form_01_04()
            {
                Height = 200;
                Width = 500;
                Text = "My first Windows Form!";
            }
        }    public class Class_01_04
        {
            public static void Main(String[] args)
            {
                Form_01_04 form=new Form_01_04();
                Application.Run(new Form_01_04());        
            }
        }
    }
      

  5.   

    Winform的程序在新建的时候应该选择WindowsApplication,而不是ConsoleApplication, ConsoleApplication是命令行程序,没有窗体和图形的