Listbox draws random white "gridlines" after column resize

Hey guys,

When I resize a column in a Listbox (Mac OS Sierra and Windows 7), Xojo 2016 R3 sometimes draws a white vertical line which looks like a grid line.

The lines appear only after resizing a column. Sometimes it is possible to resize the column in a way that the line disappears.

Mac OS:


Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) Handles CellBackgroundPaint as Boolean g.ForeColor = &cf3f6fA g.FillRect(0, 0, g.Width, g.Height) End Function

Any idea how to make the lines disappear? (Listbox.Invalidate and Listbox.InvalidateCell(-1,-1) do not change anything.



Change your FillRect:

g.ForeColor = &cf3f6fA g.FillRect(-1, -1, g.Width-2, g.Height-2)

Thanks Simon, but doesn’t work.

I would understand if it did with slightly modifying it like this:

g.FillRect(-1, -1, g.Width+1, g.Height+1)

=> but even that doesn’t change it either…

You need to return True to prevent the Xojo framework of drawing after you have drawn:

Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) As Boolean g.ForeColor = &cf3f6fA g.FillRect(0, 0, g.Width, g.Height) Return True End Function

Thanks Eli, but that does not work.

I found that the lines disappear (on Mac OS in 100% of cases, in Windows in 90%) when I set the current column width in a script again:

Dim resize_string As String = "" For i As Integer = 0 To Listbox1.ColumnCount - 1 resize_string = resize_string + Str( Listbox1.column(i).WidthActual) + "," Next

Listbox1.ColumnWidths = resize_string

This is the binary: Xojo Random “Gridlines” in Tables Sample Project

To me, it sounds more and more like a Xojo error…

tested in Linux, no white lines

Tested with El Capitan / 2016r3:

no white lines too BUT: if you resize the columns, come vertical white lines appears as you wrote earlier in this page.

WhenI select column 7 left vertical separator to move it, a white vertical line is drawn.

I never saw that because I always use the dot lines (vertical and horizontal) with a light two colored background colors.

This looks to be a never tested (or reported) thing.