c#控件说明

来源:互联网 发布:网络新词及解释 编辑:程序博客网 时间:2024/06/05 14:37

一:右键菜单面板制作

1:ContextMenuStrip,生成右键菜单的面板

2:ToolStripMenuItem,用于生成右键菜单面板上功能按扭

  ToolStripMenuItem    _visibleEnabelItem = new ToolStripMenuItem{Text = "可显示",CheckOnClick = true};
            //绑定显示按钮事件
            _visibleEnabelItem.Click -= m_visibleEnabelHandler;
            _visibleEnabelItem.Click += m_visibleEnabelHandle

3:ToolStripItem,用于保存ToolStripMenuItem生成的菜单 ToolStripItem _customTsi = new ToolStripItem[] { _visibleEnabelItem, deleteItem, renameItem, layerPropertyItem };

4:把面板和菜单功能按扭联系起来是使用ToolStripItem,然后用ContextMenuStrip保存ToolStripItem。ContextMenuStrip.items.addRange(_customTsi)

0 0
原创粉丝点击