zoukankan      html  css  js  c++  java
  • C# DEV 右键出现菜单

    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);
                    }
                }
             } 

  • 相关阅读:
    HTML自学之旅(九)框架
    暑期逛世博 品文化新上海
    重构实践者手记(20130517)
    网页信息抓取DEMO
    正则表达式30分钟入门教程
    变量命名网站
    Thinkpad笔记本电脑进入BIOS不能选择UEFI/Legacy Boot选项
    Useful Expressions Business Correspondence
    DotNetNuke升级中遇到的问题
    DNN端口的问题
  • 原文地址:https://www.cnblogs.com/YangBinChina/p/2831111.html
Copyright © 2011-2022 走看看