Listbox Problems with Selected, CellBackGroundPaint and CellTextPaint

I would like not have the first row of this list to be Selected. My listbox is comprised of “should be single character” cells and the window is called Spelling, since that is it’s function. The only cells which are NOT readonly are the ones with appropriate data. Some data is readonly, like ( ) parentheses and , commas. The data for this datum is at this link:
??? File Row Properties

I have tried several techniques, like setting Listbox.ListIndex = -1 , but this doesn’t do it here. As soon as I fill the row with data or click on a cell, the row is selected.
I have also tried to use CellBackGroundPaint and CellTextPaint.
This is what it starts off (which is correct).
??? Spelling Pre GiveUp

When I call GiveUp or Refresh the data ??? should in the ListBox, but it isn’t. See my other post Listbox Problems with my cell update
The following is the code. and the code for the event which calls them via Invalidate cell (in a cell Lost Focus event) and then the 2 cell events.

If me.Cell(row, column) <> RfrshWord(k) Then me.CellTag(row, column) = "False" me.InvalidateCell(row, column) Else me.CellTag(row, column) = "True"//It is good or has not changed End If

Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) Handles CellBackgroundPaint as Boolean If row < me.ListCount And Me.CellTag(row, column ) = "False" Then g.forecolor = CWrngColr g.fillrect (0, 0, g.width, g.height) Else g.ClearRect 0, 0, g.Width, g.Height g.ForeColor = &cffffff g.FillRect 0,0,g.width,g.height End If Return True End Function

Function CellTextPaint(g As Graphics, row As Integer, column As Integer, x as Integer, y as Integer) Handles CellTextPaint as Boolean If row < me.ListCount Then g.forecolor = &c000000 End If 'Return True End Function

This is what happens after I do my code.
??? Spelling blank Post Give Up
The only cell which I can see a “¿” is the first one (and it should be a ”?”).

why you do not insert the images here ?

click on image, paste your link and we see it here …

Argh. I could not get it to work Axel. Thanks.

Standard working.

You can use: Listbox.ListIndex = -1 after filling a Row to remove the focus to any Row.
You can also use ClearFocus after filling a Row to remove the focus to the Listbox.

I think you have to focus your attention to rule out one drawback, then another, then an… etc.

Also, what happens (in term of colors) when you move the selected Row from Row 0 to some Rows after the one(s) that have a Color change ?

InvalidateCell might be affecting more than just the one cell. You might want to keep a CurrentRow and CurrentColumn property that you can use in CellxxxPaint to affect only the one cell you care about.

I am going to start over with the window. It used to work, but now it doesn’t.
Build it as a separate project first, then integrate it.

Why is Return True commented out in CellTextPaint?