添加事件的另一种写法

this.Load += (o, e) =>
                {
                    this.treeViewItems.MouseClick += (sender, es) =>
                        {
                            if (es.Button == MouseButtons.Right)
                                this.treeViewItems.ContextMenuStrip = this.contextMenuStrip1;
                        };
                  };

 

posted @ 2014-02-19 22:19  邵明瑞  阅读(165)  评论(0编辑  收藏  举报