Shadow/outline rectangle in Listbox after moving rows

I have buttons and contextual menus for moving rows up and down in a listbox. Everything works great except on Windows, where there is a shadow/outline rectangle left behind after row gets moved. I do not see this on the macOS. I’ve tried invalidating the entire listbox and such, but I can’t make this shadow go away. In the picture, I’ve moved Test 6 row up above Test Row 5, and notice the shadow/outline rectangle left behind it.

Does anyone know of a way programmatically to makes this go away? Thanks!

By invalidating, I assume you mean you called Refresh? Is the screenshot from a test project? Have you created an issue about it?

Well, I’m still in AP1, so it’s invalidate on this project. :slight_smile:

The screenshot is from my actual project. No, haven’t filed an issue yet. Wanted to make sure it wasn’t a bug and something I needed to do in my code.

Refresh exists in API1. It (supposedly, but at times I’ve had my doubts) redraws the control immediately, whereas Invalidate, as I understand it, only redraws it at some point in the future when it’s necessary.

Correct, but you’re advised not to use it, unlike AP2 where Refresh is the common term, and false and true determine what it does.

Refresh will remove the shadow, but the Highlighted rows become out of focus. Resetting the focus makes the shadow rectangle come back.

I’ve been using RB/RS/XJ for nearly 20 years and don’t recall ever being advised not to use Refresh when it’s needed, apart from say, inside loops of course where it’s likely to cause flicker. It’s pretty essential in many cases in my experience.

See my post above. It doesn’t solve the problem.

OK, weird. Maybe something can be done differently in the row-moving code to avoid this artifact. What happens if you click on the header to sort the list (assuming sorting is enabled)?

No header, no sorting. Not that kind of Listbox. :slight_smile:

Seems like a bug. Please file a bug report.

Interestingly enough, the issue is not there when the Listbox is set to “Allow Expandable Rows”.

In my experience, neither Refresh nor Invalidate have any affect on a Listbox. Instead, use InvalidateCell(-1, -1).

That doesn’t do anything to alleviate the issue either.

What version of Xojo are you using?
Can you break the issue down into a simple demo project and post it?