博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C# DEV 右键出现菜单
阅读量:4540 次
发布时间:2019-06-08

本文共 806 字,大约阅读时间需要 2 分钟。

 

1 向工作区拖入一个DevExpress.XtraBas.Barmanager控件,拖入一个DevExpress.XtraBas.PopupMenu控件。

2 PopupMenu控件设定Manager属性是刚才拖入的Barmanager名称,在PopupMenu控件右击设定“Customise”,设定具体菜单

3 树右击菜单的代码

        /// <summary>

        /// 右击节点出现的菜单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeDistrictInfo_MouseUp(object sender, MouseEventArgs e)
        {
            TreeList tree = sender as TreeList;
            if ((e.Button == MouseButtons.Right) && (ModifierKeys == Keys.None)
                 && (treeDistrictInfo.State == TreeListState.Regular))
            {
                Point p = new Point(Cursor.Position.X, Cursor.Position.Y);
                TreeListHitInfo hitInfo = tree.CalcHitInfo(e.Location);
                if (hitInfo.HitInfoType == HitInfoType.Cell)
                {
                    tree.SetFocusedNode(hitInfo.Node);
                    popupMenu1.ShowPopup(p);
                }
            }
         } 

 

 

转载于:https://www.cnblogs.com/YangBinChina/archive/2012/12/24/2831111.html

你可能感兴趣的文章
C#微信开发之旅(一):前言
查看>>
C语言常用数学函数及其用法
查看>>
操作节点
查看>>
java Lambda
查看>>
saltstack远程执行之目标选择
查看>>
华为机试测试- 字符串最长的数字串
查看>>
ArrayDeque类的使用详解
查看>>
组合数据类型练习:
查看>>
JSON.parse()和JSON.stringify()
查看>>
Python中的列表
查看>>
将一个数据库中表的数据添加到另一个数据库
查看>>
C#委托的介绍(delegate、Action、Func、predicate)
查看>>
leetcode 76. Minimum Window Substring
查看>>
如何用Eclipse打jar包
查看>>
学习是一种投资
查看>>
banking
查看>>
Android笔记(十七) Android中的Service
查看>>
第一次作业总结
查看>>
angular1.2针对ie8的兼容问题
查看>>
JS模块化工具requirejs教程(二):基本知识
查看>>