ListBox.CellTextPaint 6px left margin?

g.FillRect (0,0, g.width,25) '25 is the specified rowheight

Issue: A 6-pixel empty left margin is left unfilled. A project from RS is being updated to Xojo and did not exhibit this behavior. In RS, the entire row was painted, in Xojo, it is not.

Is this a bug or something new in the inspector that requires a property change? If borders is turned off, the margin becomes 7px

(Windows system)

The Graphics object in CellTextPaint has not taken the whole cell in modern times… I had to take that into account with my listbox subclass.

  • Karen

Thanks Karen I thought I was doing something wrong

If you wish to fill the entire cell with a color do it in the CellBackground,Paint. That white space is the margin to space the text from the edges of the cell for readability.

On windows, the cell text paint over paints the background graphics with a solid blue color. The only way around this is to paint the background of the cell text paint, which leaves a left margin untouched. The cell background paint works perfect until the cell becomes selected otherwise.

I have found an easy solution since the margin only effects the farthest (0) left column. I moved the listbox to a container control and positioned it at -6. You would never know once compiled :slight_smile: hopefully this gets re-fixed in a newer release.

No it does not. Did you return True in CellBackgroundPaint?

  • Karen

[quote=94970:@Karen Atkocius]No it does not. Did you return True in CellBackgroundPaint?

  • Karen[/quote]

I’ve tried a bunch of different ways and that seemed to be the issue. I was returning true before “if me.Selected(row) then…” :slight_smile:

Thanks Karen!