Ok, I’m really confused. You’ve already said you need the border around the listbox itself so that isn’t the one you are having issues about. Are you objecting to the borders around the individual unselected cells? If so, you are drawing them in the Else block of your code.
I’ve been busy with work deadlines, so I haven’t had time to look at the new Betas recently, but I just compiled my main project in the r1.1b4 beta and I am noticing some odd difference in the way the ListBox DrawRect behaves now. I see all kinds of missing borders in some ListBox cells. I usually fire up my main project in the current Beta and usually never see any problems, but this one looks odd. Looks fine in 2015r3.1 which I usually work in. I’m going to try it in 2015r4 to see what it looks like there, but something is different.
Works fine in 2015r4.1 as well. Did something change with the ListBox width and height calculations in 2016r1.1 or 2016r1? This line of code in the CellBackgroundPaint event has always been like this in my code for years, to draw a bounding rectangle. Do it for all the cells and you have a grid:
g.DrawRect 0, 0, g.width, g.height
but doesn’t draw the right side and bottom portion of the Rect in 2016r1.1. But if I change it to:
g.DrawRect 0, 0, g.width - 1, g.height - 1
It looks correct to previous versions of Xojo I have worked with. I tried to install 2016r1, but the VCRedist keeps hangings the installer, not sure if I got a bad download. I don’t see anything in the Release Notes to indicate a change, but the behavior is definitely different.
Merv, is that Windows?
g.DrawRect(0, 0, g.width, g.height) is what I always use and it looks ok here on my MBP on 2016r1
I just tried and -1, -1 is really off.
Now I must say that when I draw really tiny stuff (like a 9x9 circle with a character inside), I see a slight difference between my laptop and my iMac. Not with listbox borders though.
Correct Windows 7. g.DrawRect(0, 0, g.width, g.height) is what I always used too, but in 20161.1 it has changed, at least for me on Windows. I haven’t tried it on the Mac yet, still doing some experimenting. If the behavior has changed I’ll file a Bug report tomorrow.
Looks like it is a Windows only issue. The ListBox looks incorrect running natively on Windows 7. But when I Remote Debug over to a Mac 10.9.5 machine, it looks fine in 2016r1.1b4. I’ll work up a Feedback case tomorrow.