The issue is related to styles. For some styles, the border around the listbox is not drawn correctly in line with the new style. When this happens, the bottom border is drawn correctly under the scroll bar only, when there is a vertical scroll bar. If there is no scroll bar, the listbox looks like it has 3 borders. In further testing I couldn't reproduce the top border being displayed without the style being applied. Styles bite us again.
In order to get around this, I tried using the TreeView, which does draw its borders correctly when the style changes. I have been able to almost reproduce the effect I am after. I am displaying a list of items, and do not want the tree lines to show. This is why I selected the listbox. I have been able to hide the tree lines in the treeview, but I haven't yet worked out how to align the text to the left of the display area. The place where the tree lines are normally displayed is blank, and I would prefer the text move to the left to take this space.
Is there a way to do this ?
I set LevelIndent = 0, but this didn't help.
Currently I am only using 1 column and manually indenting the second level data, as that is what I was doing in the listbox. If it is possible to drop the indenting for the tree lines for a single column treeview, that would work for me. Or even the combination of ShowLines = False and LevelIndent = 0