Beispiel #1
0
        //鼠标点击的节点设为焦点
        private void treeList1_MouseDown(object sender, MouseEventArgs e)
        {
            DevExpress.XtraTreeList.TreeList treelist = sender as DevExpress.XtraTreeList.TreeList;
            if (treelist == null)
            {
                return;
            }

            Point pt = new Point(e.X, e.Y);

            DevExpress.XtraTreeList.TreeListHitInfo ht = treeList1.CalcHitInfo(pt);
            if (ht != null && ht.Node != null)
            {
                treeList1.FocusedNode = ht.Node;
            }
            treeList1.OptionsBehavior.Editable = false;
            treeList1.CloseEditor();
        }