TreeView keep selected node highlighted

public QualityCheck()
        {
            InitializeComponent();

            //trvIndexName.HideSelection = false;
            //trvIndexName.SelectedNode.BackColor = Color.BlueViolet;  // cause DLL problem

            trvIndexName.DrawMode = TreeViewDrawMode.OwnerDrawAll;
            trvIndexName.DrawNode += new DrawTreeNodeEventHandler(trvIndexName_DrawNode);

        }

        void trvIndexName_DrawNode(object sender, DrawTreeNodeEventArgs e)
        {
            ) && (!trvIndexName.Focused))
                e.Node.ForeColor = Color.Blue;
            else
                e.DrawDefault = true;
        }

        private void trvIndexName_BeforeSelect(object sender, TreeViewCancelEventArgs e)
        {
            if (trvIndexName.SelectedNode != null)
                trvIndexName.SelectedNode.ForeColor = Color.Black;
            e.Node.ForeColor = Color.Blue;
        }

TreeView Class Key Points的更多相关文章

  1. web.xml配置web中的key points(上)

    一.定义 定义时注意:xml元素是区分大小写的. <web-app></web-app> 这些必须小写 二.url-pattern 1)url-pattern 的值必须以/或者 ...

  2. Three Key Points of Success 成功三要素

    Everyone wants to be successful. Today I would like to share three simple key points of success. Num ...

  3. DataGridView key points

    Simple Examples => http://csharp.net-informations.com/datagridview/csharp-datagridview-readonly-c ...

  4. DataSet key points

    In a typical multiple-tier implementation, the steps for creating and refreshing a DataSet, and in t ...

  5. OpenGL Shader Key Points (2)

    1.  Uniform 1.1.  Uniform变量 不是所有的变量都是跟顶点一一对应的,如变换矩阵,光源位置等. Uniform变量可以在任何类型的shader中使用,但只能作为输入值,不能在sh ...

  6. OpenGL Shader Key Points (1)

    1.  Shader起步 1.1.  可编程管线 仅考虑Vertex shader和fragment shader: 1.2.  Shader Object 在编译阶段生成,把shader源代码编译成 ...

  7. OpenGL Shader Key Points (3)

    Shader和Program Program Link过后,Shader就可以从Program中Detach并删掉.这样是不是可以节省一点点显存呢? 链接到同一个program的vertex和frag ...

  8. web.xml配置web中的key points(下)

    一.配置jsp页面 [jsp-config]中有两个子元素[taglib][jsp-property-group],注意,前者必须出现在后者之前. ①[taglib]替代jsp页面中taglib指令 ...

  9. key points & (QA) about RPKI

    @1: Q: What does ROA look like?Since ROA means which ASes are allowed for originating routes to some ...

随机推荐

  1. Jenkins控制台中文输出乱码解决方法

    1. 设置jenkins所在服务器环境变量,右键我的电脑→属性→高级系统设置→环境变量,添加JAVA_TOOL_OPTIONS 2.修改Tomcat配置,进入apache_tomcat/conf文件夹 ...

  2. Docker搭建便捷的开发者环境

    你可能遇到这样的场景:开发软件时,需要像数据库(mysql,mongodb).消息系统(rabbitmq).缓存服务(redis)等其它依赖服务.当然我们可以找台机器,一步步安装依赖,然后把所有依赖的 ...

  3. POJ2942 Knights of the Round Table(点双连通分量 + 二分图染色)

    题目大概说要让n个骑士坐成一圈,这一圈的人数要是奇数且大于2,此外有些骑士之间有仇恨不能坐在一起,问有多少个骑士不能入座. 双连通图上任意两点间都有两条不重复点的路径,即一个环.那么,把骑士看做点,相 ...

  4. BZOJ1946 : [Ceoi2006]ANTENNA

    首先通过随机增量法求出最小覆盖圆,作为答案的上界. 然后二分答案,检验的时候枚举每个点作为原点,求出其他每个点被包括在圆内的角度区间,然后扫描线即可. 时间复杂度$O(Tn^2\log n)$. #i ...

  5. MyBatis 缓存问题 session

    iBatis(MyBatis)开启缓存后,通过外部程序修改或者删除数据库记录,如何让Cache清除?5 当其外部的数据库连接甚至是数据库管理系统,对数据库进行了更改,iBatis(MyBatis)的缓 ...

  6. eclipse 高亮配对的括号

    在编辑代码框右键->preference,直接就可以看到Matching brackets highlights

  7. NOI模拟赛Day2

    深深的感受到了自己的水 ---------------------------------------------------------------------------------------- ...

  8. Sping Environment为Null的原因和解决方法

    参考:https://github.com/spring-projects/spring-boot/issues/4711 这个issue提出不到20天给我搜出来了,还是相信google的强大 问题: ...

  9. Centos 下面升级系统内核(转)

    1.导入public key     1 rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 2.安装ELRepo到CentOS 6. ...

  10. Implement strStr()

    Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle ...