Hi to all,
I have a stringgrid with only one column and 5 rows. Normally when pressing VK_DOWN(ArrowKey) the focus is transfered to next row. But when the focus is transfered to last row, how to handle this situation, so that when the focus is in last row then pressing the VK_DOWN key again in last row transfers the focus to first row of the stringgrid.
procedure TForm1.StringGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
caption := StringGrid1.RowCount.ToString + ' : ' + Stringgrid1.Row.ToString;
if (key = VK_DOWN) then begin
with(sender as tstringgrid) do begin
if (Row = (RowCount - 1)) Then Begin
Row := 0
end;
end;
end;
end;