zoukankan      html  css  js  c++  java
  • DevExpress右键菜单使用 z

    添加BarManager和popupMenu组建:

     

     

    设置popupMenu组件的Manager属性:

     

     

    右键点击popupMenu主键,点击Customize选项添加菜单:


     

     然后便可添加到鼠标事件中,此处以TreeList为例:


     

    C#代码  收藏代码
    1. private void treeList1_MouseUp(object sender, MouseEventArgs e)  
    2. {  
    3.     TreeList tree = sender as TreeList;  
    4.     if (e.Button == MouseButtons.Right   
    5.             && ModifierKeys == Keys.None  
    6.             && treeList1.State == TreeListState.Regular)  
    7.     {  
    8.         Point p = new Point(Cursor.Position.X, Cursor.Position.Y);  
    9.         TreeListHitInfo hitInfo = tree.CalcHitInfo(e.Location);  
    10.         if (hitInfo.HitInfoType == HitInfoType.Cell)  
    11.         {  
    12.             tree.SetFocusedNode(hitInfo.Node);  
    13.         }  
    14.   
    15.         if (tree.FocusedNode != null)  
    16.         {  
    17.             popupMenu1.ShowPopup(p);  
    18.         }  
    19.     }  
    20. }  
  • 相关阅读:
    C#4.0,支持动态语言?
    宁波.NET俱乐部第二次聚会WCF讲稿
    在线学习新编程
    mysql常用函数
    PHP 连接Mysql数据库
    Unix网络编程进阶计划
    RabbitMQ 安装
    Golang 变量
    Golang 结构体
    Golang 指针
  • 原文地址:https://www.cnblogs.com/zeroone/p/4311128.html
Copyright © 2011-2022 走看看