Draw a Row’s Bacground

To my great surprise, this code (below) draw the Cell Background Pink:

If Row > 0 And Row < Me.RowCount And Me.CellValueAt(Row, Column) = "Missing" Then
  g.DrawingColor = CMY(0.0,0.5,0.0)
End If

Here’s a screen shot:

As you can see, the other Rows have a full Background (same) color.

  1. It is nice to be able to do that (but why ?),
  2. I want the whole Row Background in Pink (for obvious reason). How can I do that ?

In the mean time, I keep that (better than nothing).

If Row > 0 And Row < Me.RowCount And Me.CellValueAt(Row, 5) = "Missing" Then
  g.DrawingColor = CMY(0.0,0.5,0.0)
End If

Thank you.

Yes, that’s it !

But… now, it crash when I double-click in the Cell… I added the Missing code in the text file for testing.

Side effect: if I have a title, say “The Missing Link” for example, the background will appear as Pink.

Yes, it is possible to place the code (“Missing”) in the CellTag or RowTag… but this means… far more code (to store it in the Tag at text file Read time, and at user’s write in the Cell time.

Who says “life is easy ?”
(me, when everything went right for some hours :rofl:)

I wanted to add the missing k in the title, but it is no more possible for me.

Sorry for the typo.

Ah, I see. I did find issues with the Listbox and cell background colours before. I had to invalidate the entire row, rather than just a cell to force the painting to happen in all columns.

That is not (probably) the case here. For some reason it makes the test I ask BUT paint the background only on the Column the test is valid for…
(I still do not understand)

That was my problem. I changed a state of a row, but only certain cells in that row would paint. It was quite random about the other columns. In the end I used refresh for all cells in the row and it solved the partial column issue.