我是用toolstripmenuitem来定义右键菜单项的,我想不同类型的菜单都用长线区分开来,我这么实例化菜单项的new ToolStripMenuItem("-"),发现不对  

解决方案 »

  1.   

                    ToolStripItem[] new_added_menu_items = {
                                                               new ToolStripMenuItem("-"),
                                                               new ToolStripMenuItem("定位户", null,
                                                                                     btn_locate_in_geometry_Click),
                                                               new ToolStripMenuItem("鼠标获取地理位置", null,
                                                                                     btn_mouse_get_geom_Click),
                                                               new ToolStripMenuItem("手动设置地理位置", null, btn_edit_geom_Click)
                                                           };
                    menu_items_list.AddRange(new_added_menu_items);                right_menu.Items.Clear();
                    right_menu.Items.AddRange(menu_items_list.ToArray());                right_menu.Show(Control.MousePosition);
      

  2.   

    我就想用ToolStripMenuItem这个类  实例化一个分隔符出来  怎么搞?
      

  3.   

    System.Windows.Forms.ToolStripSeparator