蔓
蔓草
Unregistered / Unconfirmed
GUEST, unregistred user!
编译可以通过,但是菜单却没有,请大家指点一下!
// project created on 2002-4-21 at 17:35
using System;
using System.Windows.Forms;
using System.Drawing;
class MainForm : Form
{
public void CreateMenu()////建立菜单的部分
{
MainMenu myMM = new MainMenu();
MenuItem MyMI=new MenuItem("文件");
MenuItem newMI=new MenuItem("新建");
MenuItem editMI=new MenuItem("编辑");
MenuItem exitMI=new MenuItem(" 退出", new EventHandler(this.endProgram),Shortcut.CtrlN);
MyMI.MenuItems.Add(newMI);
MyMI.MenuItems.Add(editMI);
MyMI.MenuItems.Add(exitMI);
Menu=myMM;
} //建立菜单的部分
public void CreateForm()////建立窗体的部分
{
this.Text = "信息管理系统";
this.StartPosition=FormStartPosition.Manual;
Point P = new Point(0,0);
this.Location=P;
Size s=new Size(800,600);
this.Size=s;
this.FormBorderStyle=FormBorderStyle.FixedSingle;
this.ControlBox=true;
this.MaximizeBox=false;
this.TopMost=true;
} ///建立窗体的部分
public static void Main(string[] args)
{
Application.Run(new MainForm());
}
public MainForm():base()
{
CreateForm();
CreateMenu();
}
protected void endProgram(object sender,System.EventArgs e)
{
Application.Exit();
}
}
// project created on 2002-4-21 at 17:35
using System;
using System.Windows.Forms;
using System.Drawing;
class MainForm : Form
{
public void CreateMenu()////建立菜单的部分
{
MainMenu myMM = new MainMenu();
MenuItem MyMI=new MenuItem("文件");
MenuItem newMI=new MenuItem("新建");
MenuItem editMI=new MenuItem("编辑");
MenuItem exitMI=new MenuItem(" 退出", new EventHandler(this.endProgram),Shortcut.CtrlN);
MyMI.MenuItems.Add(newMI);
MyMI.MenuItems.Add(editMI);
MyMI.MenuItems.Add(exitMI);
Menu=myMM;
} //建立菜单的部分
public void CreateForm()////建立窗体的部分
{
this.Text = "信息管理系统";
this.StartPosition=FormStartPosition.Manual;
Point P = new Point(0,0);
this.Location=P;
Size s=new Size(800,600);
this.Size=s;
this.FormBorderStyle=FormBorderStyle.FixedSingle;
this.ControlBox=true;
this.MaximizeBox=false;
this.TopMost=true;
} ///建立窗体的部分
public static void Main(string[] args)
{
Application.Run(new MainForm());
}
public MainForm():base()
{
CreateForm();
CreateMenu();
}
protected void endProgram(object sender,System.EventArgs e)
{
Application.Exit();
}
}