选择一个节点时候,当焦点离开这个节点的时候,treeview控件上面选择的这个节点的颜色为浅灰色,我想问问这个颜色要怎么修改啊。

解决方案 »

  1.   

    自己解决了      唉            private void Tree_Organize_DrawNode(object sender, DrawTreeNodeEventArgs e)
            {
                e.Graphics.FillRectangle(Brushes.White, e.Node.Bounds);            if (e.State == TreeNodeStates.Selected)//选中的失去焦点的节点
                {
                    e.Graphics.FillRectangle(Brushes.Yellow, new Rectangle(e.Node.Bounds.Left - 1, e.Node.Bounds.Top, e.Node.Bounds.Width - 2, e.Node.Bounds.Height)); //背景                 e.Graphics.DrawString(e.Node.Text, Tree_Organize.Font, Brushes.Black,e.Bounds.Location.X,e.Bounds.Location.Y);//字体             }
                else
                {
                    e.DrawDefault = true;
                }
            }