Description: C# to achieve the ListView to redraw the lines of the columns is a very troublesome thing, recently determined to achieve a functional requirements, each row in a ListView in the second column (Details mode) by adding a small icon. Had previously experienced the ListView settings, to open the ListView redraw the lines, you must override it OnDrawSubItem, but the ListView by default will not be implemented overloaded OnDrawSubItem your event, unless you put it OwnerDraw is set to true, that is open from user-controlled graphics mode. But people crazy is that, OwnerDraw = true, the entire ListView' s Item/SubItem/Column will all be empty out, even if you also overload OnDrawSubItem/OnDrawItem/OnDrawColumnHeader and perform inside base.OnDrawXXXXX (e), not given you have drawn.
File list (Check if you may need any files):
CustomHeader
............\AssemblyInfo.cs
............\bin
............\...\Release
............\...\.......\CustomHeader.dll
............\CustomHeader.csproj
............\CustomHeader.csproj.user
............\CustomHeader.sln
............\MyColumn.cs
............\MyColumn.resx
............\MyHeaderCollection.cs
............\MyListView.cs
............\MyListView.resx
............\Win32.cs
CustomHeaderTest
................\AssemblyInfo.cs
................\bin
................\...\Release
................\...\.......\CustomHeader.dll
................\...\.......\CustomHeaderTest.exe
................\CustomHeaderTest.csproj
................\CustomHeaderTest.csproj.user
................\Form1.cs
................\Form1.resx
新建 文本文档.txt