添加事件的另一种写法

this.Load += (o, e) =>

                {

                    this.treeViewItems.MouseClick += (sender, es) =>

                        {

                            if (es.Button == MouseButtons.Right)

                                this.treeViewItems.ContextMenuStrip = this.contextMenuStrip1;

                        };

                  };

 

你可能感兴趣的:(事件)