C#Windows窗体设计之ContextMenuStrip(鼠标右击菜单)的使用

  public Form1()

  {

  InitializeComponent();

  ContextMenuStrip contextMenuStrip = new ContextMenuStrip();//创建一个鼠标右击菜单

  /*添加项*/

  contextMenuStrip.Items.Add("我");

  contextMenuStrip.Items.Add("很");

  contextMenuStrip.Items.Add("强");

  button1.ContextMenuStrip = contextMenuStrip;//右击菜单添加到按钮button1

  }