The LVIF_
property of the Win32 classic listview control lets you indent an item in report view. The units of indentation are the size of the image list. But that requires an image list. Why does it require an image list?
The indentation feature of the classic listview control was added for Internet Mail and News, a mail and newsreader program that came with Internet Explorer 3.¹ The indentation was used to represent message threading. Since the indentation was intended to represent reply depth, it was not unreasonable for the listview’s representation of the indentation to match the underlying data’s indentation. And since each item had an icon (representing read or unread), the width of the icon was a natural unit of indentation.
But what if you don’t want an image list?
The indentation demands an image list, but you can provide a 1 × 1 image list, and choose not to show any images. The space will still be reserved, so there will be a 1 pixel gap, but maybe this small glitch isn’t noticeable. The indentation would then be in units of pixels.
Not great, but it might be the best you can do.
¹ Internet Mail and News was subsequently rebranded as Outlook Express, a rebranding which created confusion and unmet expectations.
0 comments
Be the first to start the discussion.