Recent

Author Topic: DBGrid1KeyDown  (Read 7619 times)

vigor

  • New Member
  • *
  • Posts: 10
DBGrid1KeyDown
« on: April 01, 2008, 05:37:26 pm »
I want to do something like:

procedure TForm1.DBGrid1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if (key=vk_return) then
// do something, for example:
  showmessage('Enter');
end;  

It si working in Delphi but in Lazarus  "vk_return" is wrong. What is good constant for this, and where I can find constants for other keys. I use Lazarus 0.924 and Linux Ubuntu

vigor

  • New Member
  • *
  • Posts: 10
RE: DBGrid1KeyDown
« Reply #1 on: April 01, 2008, 06:53:18 pm »
Answer is:
Include lclTypes unit in units section.
Best regards to all of you

(Now on forum are 841 unregistered and 14 registered users)

bobix

  • Jr. Member
  • **
  • Posts: 71
    • http://rechnik-bg.com
DBGrid1KeyDown
« Reply #2 on: May 06, 2008, 12:55:45 pm »
Or
if (key=13) then ...
Lazarus 1.8.4 r57972 FPC 3.0.4 i386-win32-win32/win64

researcher

  • New member
  • *
  • Posts: 8
    • http://www.habarbadi.com
Re: DBGrid1KeyDown
« Reply #3 on: May 23, 2009, 12:22:29 am »

you can get all the key codes with this -

showmessage('key is: '+inttostr(key));

just press each key, and remember the ones you need.


 

TinyPortal © 2005-2018