Link to home
Start Free TrialLog in
Avatar of LeTay
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> ?
ASKER CERTIFIED SOLUTION
Avatar of Thommy
Thommy
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LeTay
LeTay

ASKER

Will try that, thanks
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;
Avatar of LeTay

ASKER

Many thanks, it works fine !