每次用鼠标点击treeview节点的时候,默认是蓝色的,为什么我用color.blue,显示的不是这个颜色啊treeview节点的默认背景色是哪种颜色啊?请指点,谢谢大家

解决方案 »

  1.   

    弱弱的问下,system颜色 里的 Highlight 是什么意思啊 
      

  2.   

    看看这个 是不是你想要的效果
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
            {
                Color _BlackColor =Color.Red;
                Brush _FontColor =new SolidBrush(Color.Black);            TreeView _SetTreeView =(TreeView)sender;
                Bitmap _Bitmap = new Bitmap(e.Node.Bounds.Width, e.Node.Bounds.Height);
                Graphics _Graphics = Graphics.FromImage(_Bitmap);
                _Graphics.Clear(_BlackColor);
                _Graphics.DrawString(e.Node.Text, _SetTreeView.Font, _FontColor, new Point(0, 0));       
                _Graphics.Dispose();            Control _SelectControl =_SetTreeView.Controls["SelectBox"];
                if (_SelectControl == null)
                {
                    PictureBox _SelectPictureBox = new PictureBox();
                    _SelectPictureBox.Image = _Bitmap;
                    _SelectPictureBox.Bounds = e.Node.Bounds;
                    _SelectPictureBox.Name = "SelectBox";
                    _SetTreeView.Controls.Add(_SelectPictureBox);                
                }
                else
                {
                    PictureBox _SelectPictureBox = (PictureBox)_SelectControl;
                    _SelectPictureBox.Image = _Bitmap;
                    _SelectPictureBox.Bounds = e.Node.Bounds;
                }
            }