In my previous essay << high imitation Qqmusic player, talking about the production >> of WinForm about the UI, I am extremely dissatisfied with the gray scroll bar on the right side of the player list, and also affect the coordination of the whole software UI, I was determined to redraw a scroll bar that matched your UI style.
Search a lot of information, can not find a direct rewrite of the ListBox scroll bar method, can only curve the nation, first redraw a skin with the scroll bar, and then let it replace the existing scroll bar listbox.
Old habits, first pass an effect chart, you feel interested to continue to see, do not like the words to stop, lazy to delay your treasure
Expensive time, hehe.
Note that the scroll bar width in this figure is significantly less than the width of the listbox itself, and I am currently focusing on the implementation of the function, after all, the width of the adjustment is quite simple ah.
The following is a brief introduction to the detailed steps for redrawing the system scroll bar:
1. Add New item in Project--user control, we named CustomScrollbar.cs
2. To prepare a few pictures to add to the project resource as a scroll bar redraw the background, I use the following picture:
Uparrow.png Resource Name is UpArrow, scroll bar up ARROW
Thumbbottom.png Resource Name is Thumbbottom, the background of the scroll bar middle slide
Thumbmiddle.png Resource Name is Thumbmiddle, drag block in middle of scroll bar
Downarrow.png Resource Name is DownArrow, scroll bar down arrow