• 一个怎样得到treeView值的小例子


    阅读全文:http://www.cckan.net/forum.php?mod=viewthread&tid=40

    private void treeViewMenu_MouseDown(object sender, MouseEventArgs e)
            {
                if (e.Button == MouseButtons.Right)
                {
                    Point ClickPoint = new Point(e.X, e.Y);
                    TreeNode CurrentNode = treeViewMenu.GetNodeAt(ClickPoint);
                    if (CurrentNode != null)//判断你点的是不是一个节点
                    {
                        switch (CurrentNode.Name)//根据不同节点显示不同的右键菜单,当然你可以让它显示一样的菜单
                        {
                            case "website":
                                CurrentNode.ContextMenuStrip = ContentMenuDiy;

                                break;
                            case "company":
                                CurrentNode.ContextMenuStrip = ConentMenuMid;
                                break;
                            case "listItem":
                                CurrentNode.ContextMenuStrip = ContentMenuIthen;
                                break;
                        }
                        treeViewMenu.SelectedNode = CurrentNode;//选中这个节点
                    }

                }
            }

  • 相关阅读:
    php 中 return exit break contiue 详解
    C++ Primer学习笔记2--c++标准库中的 vector、string 和 bitset 类型
    asp.net 生成xml文件 与 asp生成xml文件
    android 性能优化
    Internet基础
    华为一道机试
    智能家居趋势
    hdu4708 Rotation Lock Puzzle
    java要在命令行执行eclipse的项目的方法
    linux和windows下安装python拓展包及requirement.txt安装类库
  • 原文地址:https://www.cnblogs.com/sufei/p/1411686.html
Copyright © 2020-2023  润新知