I would like move the selection bar to the next row after editing a cell in a ListBox. I cannot figure out what I am doing wrong. I have the following code in the CellAction Event of a List:
//Go to next Row
If Me.ListCount > Me.ListIndex + 1 Then
Me.Selected( Me.ListIndex + 1) = True
End If
CellAction:
Sub CellAction(row As Integer, column As Integer)
Timer1.Mode = Timer.ModeSingle
End Sub
TimerAction:
if Listbox1.ListIndex + 1 < Listbox1.ListCount then
Listbox1.ListIndex = Listbox1.ListIndex + 1
'or if you like to edit the cell
’ Listbox1.EditCell(Listbox1.ListIndex + 1,0)
end if
Timer on Window:
Timer Mode: Off
Timer Period: 60 (or more)
Because the event is called as part of some processing done by the framework. One of the things the framework does after it calls the event is to reset the highlighted line. So you set the highlight to a new line in your code, and then later the framework code sets it back to the old value. Putting your code in a timer causes your code to happen after all the framework code surrounding that event has completed.