Line break in ListView working in Vista / 7 but not in XP
I have a problem's. I am using window.forms ListView to display some data and I need to render two lines in one line. I found a solution to make the line above by adding an ImageList with the specified height and then adding Environment.NewLine to my text. It works in Vista and 7, but in XP, squares are shown instead of newlines. I'm trying to add "\ n" "\ r \ n" and ASCII char 10, but they are still squares! After a few days, I still don't know what happened and I need your help.
a source to share
Nice find, but you are using an otherwise undocumented function. Typically, Windows built-in controls do not interpret control characters. ListBox still doesn't do this, for example. The shortcut does not expand the tabs. Etcetera.
Updating the XP list is not an option, you need to use your own drawing to get it right. Use the ListView.DrawItem event, there's a good example in the MSDN library topic for it.
a source to share