Hi everyone.
I have created an application with listbox (i use it for items ordering).
I use the first column for numbering and move from cell to cell with tab key.
I use delete key to delete a row and cursor moves to the last column of the previous row (as i have planned).
When i press Shift + Tab i move to previous column and if cursor is already in the second column it moves to the previous line last column (as i have planned)
The problem is the first row (0) and second column as it does not move to TextField as planned.
I hereby attach the code for your reference.
Any help is welcomed.!!!
var grammi as Integer
var i as integer
var h as integer
grammi = lista.SelectedRowIndex
i = lista.LastColumnIndex
// Ελεγχος για το κουμπι Shift + ΤΑΒ
if key = chr(9) and keyboard.Shiftkey and i <1 and grammi =0 then
TextField8.SetFocus
End if
if key = chr(9) and keyboard.Shiftkey and column >1 then
me.EditCellAt(grammi, column -1)
end if
if key = chr(9) and keyboard.Shiftkey and column =1 and grammi >0 then
me.EditCellAt(grammi -1, 5)
end if
// Ελεγχος για το κουμπι ΤΑΒ
if key = chr (9) and not keyboard.Shiftkey and column < 5 then
me.EditCellAt(grammi, column +1)
end if
if key = chr (9) and not keyboard.Shiftkey and column = 5 and me.SelectedRowIndex<>me.LastRowIndex then
lista.EditCellAt(grammi +1, 1)
end if
if key = chr (9) and not keyboard.Shiftkey and column = 5 and me.SelectedRowIndex=me.LastRowIndex then
seira
lista.EditCellAt(grammi +1, 1)
end if
TextField11.Text = column.ToText
// ΕΛΕΓΧΟΣ ΑΝ ΠΑΤΗΘΗΚΕ ΤΟ KEY UP
if key = chr(30) and row = 0 and column = 1 then
TextField8.SetFocus
elseif key = chr(30) and column > 1 then
me.EditCellAt(row, column -1)
End if
// ΕΛΕΓΧΟΣ ΑΝ ΠΑΤΗΘΗΚΕ ΤΟ ENTER
if key = chr (13) and column < 5 then
me.EditCellAt(row, column +1)
End if
//ΕΛΕΓΧΟΣ ΑΝ ΠΑΤΗΘΗΚΕ ΤΟ DELETE
if key = chr(127) and me.SelectedRowIndex = 0 and me.RowCount = 1 then
me.RemoveRowAt(grammi)
TextField8.SetFocus
end if
if key = chr(127) and me.SelectedRowIndex = 0 and me.RowCount > 1 then
me.RemoveRowAt(grammi)
for i=0 to me.RowCount -1
h = i +1
lista.CellTextAt(i, 0) = h.ToText
next
me.EditCellAt(row, 5)
end if
if key = chr(127) and me.SelectedRowIndex > 0 then
me.RemoveRowAt(grammi)
for i=0 to me.RowCount -1
h = i +1
lista.CellTextAt(i, 0) = h.ToText
next
me.EditCellAt(row -1, 5)
End If
TextField12.Text = row.ToText
TextField11.Text = column.ToText
i attach the file so someone may test the listbox and see what is happening