Listindex bug???

  If row>=Me.ListCount Then 
    Return False
  End If
  
  If Left(Me.cell(row,0),1)="*" Then row=row+1
  me.ListIndex=row
 me.InvalidateCell(-1,-1)

No where else in the entire app is ListIndex for this listbox referred to except here (CELLCLICK event)

What I want to happen… if if the value in the cell begins with an “" I want the listbox selection to move DOWN one
(ie. I do not want the user to be able to select rows with an "
”)

BUT… when I click an “*” row… I see the row below flash… and then cursor returns to row I clicked

It is not a Cocoa vs Carbon thing… I tried it both ways (fails under WIndows 7 also)

and if I click on the “*” row 3 or 4 times… THEN finally it jumps to the next row like I want

If I query LISTINDEX right after the invalidate above… I get the row # I expect…
but both CellPaint and CellText say the row is the one I clicked (Invalidate should have updated it)

NEVERMIND :slight_smile:

You must RETURN TRUE in the CellClick for anything to “matter”

do you try only remplace text?
by example

a=list.cel(row,0)
list.cel(row,0)=list.cel(row+1,0)
list.cel(row+1,0)=a

No… because I do not wish to change the contents of the cells.

If they click on row 5, and row 5 has an “*” then I want it to look like (and act like) they clicked row 6

If row>=Me.ListCount Then 
    Return False
  End If
  
  If Left(Me.cell(row,0),1)="*" Then row=row+1
  me.ListIndex=row
 me.InvalidateCell(-1,-1)
RETURN TRUE