ContextMenu cm =new ContextMenu();//新建右键菜单
            MenuItem mi =new MenuItem();//新建右键菜单项
            mi.Header ="菜单项";
            mi.Click
+= MenuItem_Click;//为菜单项注册事件     
            cm.Items.Add(mi);
            ContextMenuService.SetContextMenu(btnRight, cm);
//为控件绑定右键菜单

posted on 2013-04-01 09:11  bzryk  阅读(124)  评论(0编辑  收藏  举报