在winfrom设计中listview的滚动条如何改变颜色 1C

在网上找到了代码 protected override void OnPaint(PaintEventArgs e)
{
//Rectangle re = new Rectangle(this);
base.OnPaint(e); // Visual styles are not enabled.
if (!ScrollBarRenderer.IsSupported)
{
this.Parent.Text = "CustomScrollBar Disabled";
return;
} this.Parent.Text = "CustomScrollBar Enabled"; // Draw the scroll bar track.

        ScrollBarRenderer.DrawRightHorizontalTrack(e.Graphics,
            ClientRectangle, ScrollBarState.Normal);    // Draw the thumb and thumb grip in the current state.
                ScrollBarRenderer.DrawRightHorizontalTrack()
        ScrollBarRenderer.DrawHorizontalThumb(e.Graphics,
            ClientRectangle, ScrollBarState.Normal);
        ScrollBarRenderer.DrawHorizontalThumbGrip(e.Graphics,
            ClientRectangle, ScrollBarState.Normal);    // Draw the scroll arrows in the current state.
        ScrollBarRenderer.DrawArrowButton(e.Graphics,
                ClientRectangle, ScrollBarArrowButtonState.LeftNormal);

        ScrollBarRenderer.DrawArrowButton(e.Graphics,
                ClientRectangle, ScrollBarArrowButtonState.LeftNormal);  
                } 看懂了一部分,但没发现在那儿可以更滚动条的颜色的。哪位大神知道该如何更改呢?原来滚动条是白色的,我想改成![图片说明](https://img-ask.csdn.net/upload/201605/17/1463454810_765264.png)这种颜色的,该怎样重绘listview呢?

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐