Beispiel #1
0
        private void treeList1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            try
            {
                DevExpress.XtraTreeList.TreeList tree = sender as DevExpress.XtraTreeList.TreeList;

                DevExpress.XtraTreeList.TreeListHitInfo info = tree.CalcHitInfo(tree.PointToClient(MousePosition));
                if (info.HitInfoType == DevExpress.XtraTreeList.HitInfoType.Cell)
                {
                    TreeListNode node = info.Node;

                    tree.FocusedNode = node;
                    AddLayerToMapControl(node);
                }
            }
            catch
            {
            }
        }
Beispiel #2
0
        private void treeList1_MouseUp(object sender, MouseEventArgs e)
        {
            try
            {
                DevExpress.XtraTreeList.TreeList tree = sender as DevExpress.XtraTreeList.TreeList;

                if (e.Button == MouseButtons.Right && ModifierKeys == Keys.None && tree.State == TreeListState.Regular)
                {
                    Point           ptTreeList = tree.PointToClient(MousePosition);
                    Point           pt         = Control.MousePosition;
                    TreeListHitInfo info       = tree.CalcHitInfo(ptTreeList);
                    if (info.HitInfoType == HitInfoType.Cell)
                    {
                        clickNode        = info.Node;
                        tree.FocusedNode = clickNode;
                        this.contextMenuStrip1.Show(pt);
                    }
                }
            }
            catch
            {
            }
        }