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 its 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 doesnt 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 isnt. 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 ?).