First look at the effect:
. Net built-in listview control itself has some bugs, for example, when you set the display mode to tile (tile) style, select different items, some selected backgrounds are not completely refreshed, and some focus boxes are left. During the beautification process, I tried my best to pay attention to these problems, but I did not perform too many tests. There may also be some problems, first, let's talk about the implemented and unimplemented functions.
Implemented functions:
1. Change the border color.
2. When the display mode is details and list, different background colors are displayed for the separated items.
3. When the display mode is details, beautify the list header.
4. Background beautification after selecting items of various display styles (largeicon, smallicon, list, tile, and details.
Features not implemented:
1. checkbox cannot be displayed. This cannot be drawn. The problem is that the position displayed in the checkbox cannot be obtained, because only the default position of the checkbox is clicked, and that item will be selected, if the checkbox you have drawn is not the same as the default position, it is useless to click it. Therefore, checkbox is not supported.
You can use the getbounds method to obtain the position and size of the icon and text, that is, the checkbox is not obtained. It is easier to draw the largeicon, smallicon, and list display styles. To draw the details style, you must note that the background is drawn when the fullrowselect settings are different. tile style text is easier to draw, the position and size of each subitem text must be calculated separately. It is very easy to draw an icon if it is not selected. To achieve the effect that comes with the system, you need to use the API function: imagelist_geticon. The specific method is as follows, let's take a look at all the drawing code :......
For the complete article, see "listview (4) of the C # winform control beautification extension series-beautifying all styles".