a_number 2016-05-17 03:10 采纳率: 60%
浏览 2709
已结题

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

在网上找到了代码 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条回答 默认 最新

  • threenewbee 2016-05-17 17:44
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿