LeTay
asked on
Event on keyboard <Enter> key in TStringGrid
I just want to know if there is an event associated with the press of <Enter> key on a cell in a TStringGrid.
If not, how can i catch that <Enter> ?
If not, how can i catch that <Enter> ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You may also use OnKeyPress Event...
procedure TForm1.StringGrid1KeyPress (Sender: TObject; var Key: Char);
begin
if key=#13 then begin
Showmessage('Return (OnKeyPress)'+#10+
'Current cell col: '+inttostr((sender as TstringGrid).Col)+#10+
'Current cell row: '+inttostr((sender as TstringGrid).Row)
);
end;
end;
procedure TForm1.StringGrid1KeyPress
begin
if key=#13 then begin
Showmessage('Return (OnKeyPress)'+#10+
'Current cell col: '+inttostr((sender as TstringGrid).Col)+#10+
'Current cell row: '+inttostr((sender as TstringGrid).Row)
);
end;
end;
ASKER
Many thanks, it works fine !
ASKER