Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delphi : move between cells of string grid

How can I move between cells of a string grid in Delphi by tab or arrow keys? As you know, a string grid in delphi has only one tab order but I need to move between cells by arrow keys or tab to be more comfortable and user friendly .

I tried to use a KeyPress event, but this event only knows chars and doesn't know control keys like tab and ...

like image 772
Arash Avatar asked Jul 13 '11 12:07

Arash


1 Answers

StringGrid.Options := StringGrid.Options + [goEditing, goTabs];

Or set this designtime.

Now you can move from cell to cell with tab and arrow keys. If you are actually editing a cell, then you have to release the focus first if you want to move to the cell to the left or right. In that case, use (shift) tab.

like image 133
NGLN Avatar answered Sep 30 '22 14:09

NGLN