我刚学C#不久,现在打算显示一个windows的窗体出来,但是编译的时候总是出错,请高手帮帮忙看看问题出左哪里了,
代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ConsoleApplication1
{
public partial class Form1 : Form
{
System.Windows.Forms.MainMenu Mainmenu;
System.Windows.Forms.MenuItem item1;
//System.Windows.Forms.MenuItem item2;
public Form1()
{
InitializeComponent();
}
void InitializeComponent()
{
Mainmenu = new MainMenu();
item1 = new MenuItem("Open");
// item2 = new MenuItem("Exit");
Mainmenu.MenuItems.Add(item1);
// Mainmenu.MenuItems.Add(item2);
this.Menu = Mainmenu;
}
static void Main()
{
Application.Run(new Form1());
}
}
}